You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(feed-debug): per-session maps are resurrected by an append queued before forget #1207
Found by the #1111 review (2026-09-25), deferred from that PR as a follow-up because it predates it.
Problem
src/main/storage/feedDebugLog.ts keeps per-session maps: lastWrittenFeedDebugId, feedDebugCapState, and since #1111lastWrittenFeedDebugEpoch. forgetFeedDebugSession deletes them synchronously. But an append that was queued before the forget and has not started yet runs afterwards and writes the entries back. Queue settlement only reaps feedDebugWriteQueues, so nothing removes them again.
Reproduction (reviewer's probe): for 100 session ids, queue one real append, call forgetFeedDebugSession immediately, and await the writes. The epoch map keeps 100 dead entries. The id and cap maps have the same ordering problem.
Cost: a few numbers per closed session for the life of the process. It is small, but it grows without bound.
Fix direction
Give each session a forget generation: capture it when the append is queued, and skip every map write (or delete again at the end of the continuation) if it changed. Cover all three maps, and test with the real queue ordering, not a mock.
Activity
fix(feed-debug): make a generation's epoch unique, and pin the contra…