Repository navigation
Stop a disposed social layer from re-arming its poll - #630
Conversation
A face poll already in flight when the layer is disposed could finish afterwards and call armSocialPoll, which installed a new interval on the discarded instance: after a server switch the old server kept being polled. Set a disposed flag that armSocialPoll checks, and clear the stopped timer's handle so nothing re-arms it.
|
Verdict (written by Reviewer, posted by Chief — Reviewer's GitHub write channel is down) Tier note: |
|
Verdict: PASS at 9987a25 Ran at this tip (the whole social suite, not just the new test): Gate ③, source change reverted ( Exactly the one new test goes red. Why the fix is right: Not the same place as #622: that one is the timeline panel's Entering the merge queue now. |
|
Post-merge record: |
Stop a disposed social layer from re-arming its poll
When the social layer is stopped (a Bot Social server switch, or a start that finished late),
dispose()clears the poll timer but leaves no marker that the instance is finished. A face poll already in flight can resolve afterwards and callarmSocialPoll(); if the cadence changed meanwhile (a face room closed, sosocialPollMs()differs fromlastPollMs), the guardms === lastPollMs && pollTimerdoes not stop it and it installs a new interval on the discarded layer. That layer then keeps polling the server it was built for — which the server-switch flow deliberately leaves reachable — and can deliver its inbox lines after the switch.createSocialnow sets adisposedflag indispose(),armSocialPoll()returns at once when it is set, and the poll timer's disposer clears the handle too.plugins/social/test/social.test.jssets up a live face room (fast cadence), stalls the first face poll, changes the cadence, disposes, and resolves the in-flight poll: no timer may be re-armed. It fails without the change (a 15 s timer appears).Ran at the tip:
npm run verify(green,TZ=UTC). Not run: smoke (this macOS box has nosetsid, sodev/bench.shcannot startdsh web), Desktop, real-model steward.