BOLT-931: Fix bulk-import duplicate-enrollment bug + backfill DSGS dupes
completedAgent: sergey-engineer
Priority: 2
Branch:
havoc/bolt-931-bulk-import-dedupPR: #10625
Linear: BOLT-931
Bulk-import customer-site-device worker creates duplicate program.Enrollment rows on retry. Found while Grace was loading 2026 DSGS at Solridge (job cmp6d6blx0080sp1sn4ds3ws7): 596 CSV rows → 627 enrollment rows (31 dupes within seconds of each other, same referenceId+serial, retries landing as new inserts). Plan: (1) add @@unique on (workspaceProgramId, referenceId, serialNumber) in Prisma + migration, (2) make bulk-import enrollment writer idempotent (upsert), (3) backfill-dedupe the 31 existing dupes on WorkspaceProgram cmowjwxmp0001100ro2bf0nyn, (4) audit other recent bulk-import jobs for the same pattern. Linear: BOLT-931. Reporter: Grace Pevehouse.
Event Timeline
created
status_change
queued → in_progress
failed
lease expired — re-queued for retry
in_progress → queued
status_change
queued → in_progress
progress
PR opened: https://github.com/TextureHQ/mono/pull/10625. All local tests passing (1060 pass, 0 fail). Awaiting CI + review.
failed
lease expired — re-queued for retry
in_progress → queued
status_change
queued → in_progress
progress
PR #10625 pushed, all blocking CI green. Awaiting review. Registered in .blockers.env.
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
status_change
failed → completed