Commit 561a30c
committed
fix: prevent duplicate conversations from self-messages and relay backfill
- Add message deduplication using Set to track processed message IDs
- Filter out self-messages where sender = recipient
- Prevents duplicate conversation entries from:
* Same message arriving from cache AND real-time subscription
* Self-directed messages creating spurious conversations
- Ensures normal sent messages still appear in recipient conversations
- Reduces conversation count from 8 to 7 (removes duplicate)
Fixes issue where fast cache loading (0.5ms) creates race condition
with real-time subscription receiving backfill messages already in cache.1 parent 285bd37 commit 561a30c
1 file changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
94 | 116 | | |
95 | 117 | | |
96 | 118 | | |
| |||
173 | 195 | | |
174 | 196 | | |
175 | 197 | | |
176 | | - | |
| 198 | + | |
177 | 199 | | |
178 | 200 | | |
179 | 201 | | |
| |||
0 commit comments