Commit 31e6a6e
fix(chat): drop orphaned pending-id event rows (ghost duplicates)
Mid-flight persists (upload progress, preview updates) could land a DB
row under a message's optimistic pending id; the finalized message then
saved under its REAL id, orphaning the pending-keyed row as a ghost
duplicate that renders on reload. 92 such rows existed in a live
long-running account.
on_sent now deletes the pending-keyed row once the finalized id lands
(session-guarded; the shared delete also retreats a read marker that
pointed at it), and migration 64 sweeps existing orphans. Rows still
flagged pending or failed are live send-state for the retry UI and
stay untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 6330108 commit 31e6a6e
2 files changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
752 | 769 | | |
753 | 770 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
103 | 114 | | |
104 | 115 | | |
105 | 116 | | |
| |||
0 commit comments