Skip to content

Commit 4cc027f

Browse files
tonio-alucemaPaperclip-Paperclipclaude
committed
docs(server): explain why the seed's issue idempotency key is not revision-scoped
Cloud's reconcile runs off portfolio fetches, which can overlap, so two pushes of the same revision can race. The idempotency key on the first task is what makes that safe. It is deliberately company-scoped rather than revision-scoped, so that a later revision still dedupes against whatever the first push created if the recorded issue id is lost. That reasoning was not obvious from the call site. Co-authored-by: Paperclip <noreply@paperclip.ing> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent d66f435 commit 4cc027f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

server/src/services/onboarding-seed.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ export function onboardingSeedService(db: Db) {
233233
});
234234
} else {
235235
const projectId = await resolveOnboardingProjectId(companyId, goalId);
236+
// The idempotency key is what protects two pushes that arrive at once
237+
// — Cloud's reconcile runs off portfolio fetches, which can overlap.
238+
// It is deliberately not revision-scoped: if the recorded issue is
239+
// lost, a later revision should still dedupe against whatever the
240+
// first push created.
236241
const created = await issueSvc.create(companyId, {
237242
title: firstTaskTitle,
238243
...(firstTaskDetails ? { description: firstTaskDetails } : {}),

0 commit comments

Comments
 (0)