Repository navigation
Commit 19ef2a9
committed
Give seeded notifications stable IDs so overlapping seeds don't duplicate them
From review: the seed reads a user's existing notifications and then
inserts the missing ones, so two seeds running at the same time could
both insert the same notification under different random IDs. Derive
each ID from the org, user, and template, so the second insert hits
onConflictDoNothing. Two concurrent seeds on a local database now
insert 280 notifications instead of 490. The text check stays for rows
that older seeds created with random IDs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsE8hW2Sa81QXuqHAStNNa1 parent 90ac485 commit 19ef2a9
1 file changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
581 | 580 | | |
582 | 581 | | |
583 | 582 | | |
584 | | - | |
585 | | - | |
| 583 | + | |
| 584 | + | |
586 | 585 | | |
587 | 586 | | |
588 | 587 | | |
| |||
594 | 593 | | |
595 | 594 | | |
596 | 595 | | |
597 | | - | |
598 | | - | |
599 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
606 | | - | |
| 606 | + | |
| 607 | + | |
607 | 608 | | |
608 | 609 | | |
609 | 610 | | |
| |||
0 commit comments