Skip to content

Commit 3bba9f7

Browse files
committed
Fix blocking git status refresh and remove redundant error suppression
- Use Effect.forkDetach() in refreshGitStatus to fire-and-forget the status refresh instead of blocking RPC responses and stream completion. This prevents multi-second delays from potential git fetch calls in refreshRemoteStatus from keeping isGitActionRunning true in the UI. - Remove redundant Effect.ignore({ log: true }) at gitPull and gitRunStackedAction call sites since refreshGitStatus is already infallible after Effect.ignoreCause({ log: true }).
1 parent f3bc116 commit 3bba9f7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

apps/server/src/ws.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ const WsRpcLayer = WsRpcGroup.toLayer(
353353
const refreshGitStatus = (cwd: string) =>
354354
gitStatusBroadcaster
355355
.refreshStatus(cwd)
356-
.pipe(Effect.ignoreCause({ log: true }), Effect.asVoid);
356+
.pipe(Effect.ignoreCause({ log: true }), Effect.forkDetach(), Effect.asVoid);
357357

358358
return WsRpcGroup.of({
359359
[ORCHESTRATION_WS_METHODS.getSnapshot]: (_input) =>
@@ -581,9 +581,7 @@ const WsRpcLayer = WsRpcGroup.toLayer(
581581
[WS_METHODS.gitPull]: (input) =>
582582
observeRpcEffect(
583583
WS_METHODS.gitPull,
584-
git
585-
.pullCurrentBranch(input.cwd)
586-
.pipe(Effect.ensuring(refreshGitStatus(input.cwd).pipe(Effect.ignore({ log: true })))),
584+
git.pullCurrentBranch(input.cwd).pipe(Effect.ensuring(refreshGitStatus(input.cwd))),
587585
{ "rpc.aggregate": "git" },
588586
),
589587
[WS_METHODS.gitRunStackedAction]: (input) =>
@@ -600,10 +598,7 @@ const WsRpcLayer = WsRpcGroup.toLayer(
600598
.pipe(
601599
Effect.matchCauseEffect({
602600
onFailure: (cause) =>
603-
refreshGitStatus(input.cwd).pipe(
604-
Effect.ignore({ log: true }),
605-
Effect.andThen(Queue.failCause(queue, cause)),
606-
),
601+
refreshGitStatus(input.cwd).pipe(Effect.andThen(Queue.failCause(queue, cause))),
607602
onSuccess: () =>
608603
refreshGitStatus(input.cwd).pipe(
609604
Effect.andThen(Queue.end(queue).pipe(Effect.asVoid)),

0 commit comments

Comments
 (0)