Repository navigation
Commit 98805b8
authored
fix(auto-reply): reject redeliveries without recreating drained queues (#124723)
enqueueFollowupRun called getFollowupQueue (which inserts into the
process-global FOLLOWUP_QUEUES registry) before the recent-message-id
dedupe peek. A provider redelivery arriving after the original queue
drained and self-deleted recreated the registry entry, was rejected by
the peek, and left an empty FollowupQueueState (AbortController, arrays,
WeakSets) in the map forever — registry entries are only deleted when a
drain finishes, and a queue with no items never drains. Long-lived
gateways leaked one state object per redelivered session key.
Root cause: mutation-before-validation ordering. The dedupe key
derivation does not need the queue, so the peek now runs first and the
registry entry is only created for admitted work.
Regression: new dedupe test drains a queue to self-deletion, replays the
message, and asserts no registry entry reappears — fails pre-fix.1 parent 8f23e68 commit 98805b8
2 files changed
Lines changed: 46 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
255 | 297 | | |
256 | 298 | | |
257 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
| |||
0 commit comments