mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(desktop): pass-2 correction C7 — degraded results observable + AppShell composite key
spawn_event_sync returns Result<(), String> so dispatch failure can be captured
by the workspace-apply post-commit section rather than being silently ignored.
The value is always Ok(()) since tauri::async_runtime::spawn is infallible; this
establishes the typed interface for future signaling.
try_regenerate_nest returns Result<(), String> instead of swallowing errors.
All fire-and-forget callers updated to .ok() to explicitly discard the Result.
apply_workspace post-commit:
- try_regenerate_nest moved out of the spawn_blocking closure into the async
post-commit section so its Result can populate the degraded vec.
- spawn_event_sync Result captured; dispatch failure pushed to degraded.
- Nest failure reported as 'nest context regeneration failed: ...' degradation.
useCommunityInit.ts: post-commit degraded items now emit a toast.warning (8 s)
via sonner so the user sees partial failures. Previously only console.warn.
AppShell.tsx: useManagedAgentRuntimeReconciliation key changed from
String(reinitKey) to `${activeCommunity?.id}-${reinitKey}`. A same-relay
identity swap (new communityId, unchanged reinitKey) now correctly re-triggers
runtime reconciliation. Destructured activeCommunity and reinitKey from
communitiesHook and updated two other call sites for consistency.
dead pub use exports in migration.rs removed (fold, backfill, detach, strip,
materialize — all now accessed only through scoped _in_dir/_at variants).
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
co-authored by
Will Pfleger
parent
18c4be359d
commit
372b0fabd9
@@ -1,6 +1,7 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { isTauri } from "@tauri-apps/api/core";
|
||||
import { isMacPlatform } from "@/shared/lib/platform";
|
||||
import { toast } from "sonner";
|
||||
|
||||
import { relayClient } from "@/shared/api/relayClient";
|
||||
import { resetRateLimitGate } from "@/shared/api/relayRateLimitGate";
|
||||
@@ -238,13 +239,19 @@ export function useCommunityInit(
|
||||
return;
|
||||
}
|
||||
|
||||
// Workspace applied. Log any post-commit degradation (informational —
|
||||
// the workspace IS active; these are best-effort post-commit steps).
|
||||
// Workspace applied. Surface any post-commit degradation as a
|
||||
// user-visible warning toast — the workspace IS active, but some
|
||||
// best-effort post-commit steps failed (nest, event-sync, restore).
|
||||
if (applyResult.degraded.length > 0) {
|
||||
const reason = applyResult.degraded.join("; ");
|
||||
console.warn(
|
||||
"[useCommunityInit] workspace applied with degradation:",
|
||||
applyResult.degraded,
|
||||
);
|
||||
toast.warning("Workspace applied with partial failures", {
|
||||
description: reason,
|
||||
duration: 8000,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
// A bad `repos_dir` no longer reaches here — `apply_workspace` treats
|
||||
|
||||
Reference in New Issue
Block a user