Skip to content

Ignore data left behind by participants who were already gone - #108

Merged
jodeleeuw merged 2 commits into
mainfrom
fix/ghost-participants
Sep 28, 2026
Merged

jodeleeuw merged 2 commits into
mainfrom
fix/ghost-participants

Conversation

@jodeleeuw

Copy link
Copy Markdown
Member

Picks up a core fix on jspsych/jsPsych#3694 (1c3623b9, preview 1e77da41).

The problem

In link-based sessions (the Local adapter, or Firebase with ?mp_session=), data left behind by someone who wasn't connected when a participant joined started out away. It became left 10 seconds later, and onParticipantLeft fired. That data can come from a reused link or from someone who dropped out before the others arrived. A study that ends the game from onParticipantLeft could therefore end for a participant who never met the person who "left". The leftover data also showed in getAll(), so it could count toward a new trial's wait().

The fix (core)

Without a sealed group, a participant counts only once this client has seen them connected. Until then they are left out of presence(), getAll()/get(), and group().members. In a sealed group every roster member is still tracked, so a member who never connects still becomes away and then left.

Trade-off: a real partner whose connection is down at the exact moment someone joins isn't counted until they reconnect from the same page. From this client's side that is indistinguishable from leftover data. Waits still end by their timeout, and sealed groups are unaffected.

This PR

  • Vendors the new preview and re-pins the docs and example pages.
  • Updates comments and docs that explained behavior by "leftover data starts out away": the utils remainingParticipants comment, the test backend, the dropouts guide, and the role and match READMEs.

Testing

  • 500 core tests pass, including two new ones:
    • leftover data, even in a trial scope, stays invisible and never fires onParticipantLeft;
    • a partner who was offline at join is counted once back, then tracked normally.
  • 823 ecosystem tests pass, and npm run build is clean.

🤖 Generated with Claude Code

jodeleeuw and others added 2 commits September 28, 2026 10:06
Matches the core change that ignores data left behind by someone who was
gone before a participant arrived.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vendors preview 1e77da41 (core 1c3623b9).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jodeleeuw
jodeleeuw merged commit e5a8ac9 into main Sep 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant