Commit 0dc7142
committed
fix(core): keep bufferSeqNums in lock-step on session-stream on()-drain
`on()`'s buffer-drain block called `this.buffer.delete(key)` after
handing buffered records to the new handler but didn't delete the
parallel `this.bufferSeqNums` entry. The next `#dispatch` that buffered
a record would then append onto the orphaned seqNum array, and a
subsequent `once()` / `shiftBuffer()` would advance
`lastDispatchedSeqNum` with a stale seq — which would land on the next
`turn-complete` control record's `session-in-event-id` header and
cause the next worker boot to under-skip `.in`. Matches the cleanup
pattern already used in shiftBuffer / disconnectStream / reset.1 parent ffc52b4 commit 0dc7142
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
0 commit comments