GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): retry branch metadata compensation after Git rollback · pingdotgg/t3code@bf59077

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/orchestration-v2
    • TemporaryBranchNaming.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/orchestration-v2/TemporaryBranchNaming.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/TemporaryBranchNaming.ts
+24-5Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { CommandId, ThreadId, type ChatAttachment, type ProjectId } from "@t3too
22
import { isTemporaryWorktreeBranch } from "@t3tools/shared/git";
33
import { resolveProjectSettings } from "@t3tools/shared/projectSettings";
44
import * as Context from "effect/Context";
5+
import * as Duration from "effect/Duration";
56
import * as Effect from "effect/Effect";
67
import * as Layer from "effect/Layer";
78
import * as Ref from "effect/Ref";
@@ -27,7 +28,6 @@ type NamingInput = {
2728
readonly message: {
2829
readonly text: string;
2930
readonly attachments: ReadonlyArray<ChatAttachment>;
30-
readonly context?: string;
3131
};
3232
};
3333

@@ -83,7 +83,6 @@ const make = Effect.gen(function* () {
8383
cwd,
8484
message: input.message.text,
8585
attachments: input.message.attachments,
86-
...(input.message.context ? { context: input.message.context } : {}),
8786
modelSelection,
8887
});
8988
const sharing = (branch: string) =>
@@ -150,9 +149,29 @@ const make = Effect.gen(function* () {
150149
newBranch: oldBranch,
151150
exactName: true,
152151
});
153-
for (const thread of yield* sharing(renamed.branch)) {
154-
yield* update(thread.id, renamed.branch, oldBranch, "branch-rollback");
155-
}
152+
// Git is already restored; retry only metadata reads and guarded writes.
153+
yield* Effect.gen(function* () {
154+
const visited = new Set<ThreadId>();
155+
while (true) {
156+
const remaining = yield* sharing(renamed.branch);
157+
if (remaining.length === 0) break;
158+
for (const thread of remaining) {
159+
if (visited.has(thread.id))
160+
return yield* new BranchMetadataPublicationStalled({ threadId: thread.id });
161+
visited.add(thread.id);
162+
yield* update(thread.id, renamed.branch, oldBranch, "branch-rollback");
163+
}
164+
}
165+
}).pipe(
166+
Effect.retry({
167+
while: (error) => error._tag !== "BranchMetadataPublicationStalled",
168+
schedule: Schedule.exponential("100 millis").pipe(
169+
Schedule.modifyDelay(({ duration }) =>
170+
Effect.succeed(Math.min(Duration.toMillis(duration), 5000)),
171+
),
172+
),
173+
}),
174+
);
156175
return yield* Effect.failCause(cause);
157176
}),
158177
),

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.