Repository navigation
fix(social): keep a face room open until its peers are really gone (#1606) - #1608
Conversation
faceSnapshotPast treated a single snapshot whose members omitted the peer as "every other home left" and closed the room, then applyFaceSnapshot left it on Bot Social. Right after face-start the member list lags behind the seats, so a fresh open room flipped to closed within seconds. An open room now ends only when two consecutive snapshots agree that no other home is there, or when a snapshot carries the leave event itself. One incomplete snapshot neither closes the room nor sends face-leave. Docs-not-needed: behaviour fix inside plugins/social/src/social.js only; no protocol or architecture change.
faceSnapshotPast treated a single snapshot whose members omitted the peer as "every other home left" and closed the room, then applyFaceSnapshot left it on Bot Social. Right after face-start the member list lags behind the seats, so a fresh open room flipped to closed within seconds. An open room now ends only when two consecutive snapshots agree that no other home is there, or when a snapshot carries the leave event itself. The seats a room has listed are remembered per room, so a peer that a snapshot dropped stays a peer. One incomplete snapshot neither closes the room nor sends face-leave. Docs-not-needed: behaviour fix inside plugins/social/src/social.js and its test; no protocol or architecture change.
|
Verdict: PASS at 4e645db Ran at this tip: Tier: T3 ( Red first, with only
Scope (compare Checks at this tip: all 15 runs are terminal; Design conformance (#1606 ruling: one snapshot with a missing/empty member list must never close an open room and never Non-blocking notes for a later cleanup, not reasons to hold this tip:
|
Written-by: Claim 26ac
Fixes #1606
Owner: Chief
Reviewer: Reviewer
Tip SHA: 4e645db
Base: 3ad6355
Docs-not-needed: behaviour fix inside plugins/social/src/social.js and its test; no protocol or architecture change.
face-startseats the peer here at once while the server's member list lags; one peerless snapshot closed the room and sentface-leave, so both homes lost it 1–3 s after startfaceSnapshotPastcloses only on the caller'speerGone: two snapshots in a row with no other home, or a snapshot carrying themember.leftevent. The seats a room ever listed are remembered per room, so a snapshot that drops a peer does not erase it#1606:case; five existing cases that assumed one peerless snapshot was a leave now poll twicecore/,patches/, server protocol, docsWhat changed
plugins/social/src/social.js: a newfacePeersGonedecides, per room, when the other homes are really gone — it keeps the set of remote seats the room has listed (hosted participants and snapshot members), counts consecutive snapshots with none of them, and treats a snapshot that carries amember.leftevent as the leave itself.faceSnapshotPasttakes that verdict aspeerGoneinstead of re-deriving it frompreviousRemotes.length > 0 && currentRemotes.length === 0. Theface-leaveat the end ofapplyFaceSnapshottherefore only runs on the confirmed path.plugins/social/test/social.test.js: the new#1606case starts a room with a remote peer, then serves a snapshot with an empty member list — the room staysopenand noPOST /frm_…/leaveis made; the second agreeing snapshot closes it and does leave. The five existing#182/#304/#458/#1072cases that removed the peer and asserted a close after one poll now poll twice, with the first poll asserting the room is still open.Red first
With
src/social.jsswapped back to the base blob3d25ec99ad0e, the new case fails:one peerless snapshot keeps the room open— actual'closed', expected'open'(the base run also sends the leave). At the tip the same case passes.Ran
cd plugins/social && node --import ./test/resolve.mjs --test "test/*.test.js"— 528 tests, 528 pass, 0 fail at this tip (Node 22.23.3). Base-blob run of the new case: 1 fail as above.Not run
Root
npm run verify,npm ci/npm run harness, plugin lint, smoke: this box has no git binary and no dependency tree of its own, so the suite ran in a directory copy of the v0.2.13 tree (a00658ccc97b) with only these two files at this tip, against the sharedDSH_HARNESS. CI runs the full verify at the tip.{
"pr": 1608, "claim": "Chief", "issue": 1606,
"summary": "A face room closed 1-3 s after face-start because one snapshot whose members list had not caught up was read as 'every other home left', and the automatic face-leave then ended the room on Bot Social. The room now ends only when two snapshots in a row list no other home, or when a snapshot carries the leave event itself; the remote seats the room has listed are remembered per room, so a dropped peer does not look like a room of one. One incomplete snapshot neither closes the room nor sends face-leave.",
"files": ["plugins/social/src/social.js", "plugins/social/test/social.test.js"],
"checks": { "ran": "cd plugins/social && node --import ./test/resolve.mjs --test "test/*.test.js"; base-blob run of the #1606 case", "result": "green", "at": "4e645db3fc11bce74569e08bd4859b03a910bc02" },
"next": "Ready for review: one conclusion at this tip; the five adapted #304/#182/#458/#1072 cases keep their one-poll semantics twice over."
}