Skip to content

🐛 Assign presence handlers to RemoteDocPresence prototype#714

Open
alecgibson wants to merge 1 commit into
masterfrom
fix-remote-doc-presence-prototype-mutation
Open

🐛 Assign presence handlers to RemoteDocPresence prototype#714
alecgibson wants to merge 1 commit into
masterfrom
fix-remote-doc-presence-prototype-mutation

Conversation

@alecgibson

Copy link
Copy Markdown
Collaborator

Fixes #708

At the moment, _handleCreateDel and _handleLoad are assigned to RemotePresence.prototype rather than RemoteDocPresence.prototype.

RemotePresence is the base class, and RemoteDocPresence is the only subclass, so these handlers still happen to be reachable via the prototype chain and the bug is invisible in practice. However, defining them on the base prototype pollutes it, and any future sibling subclass would silently inherit doc-specific presence handlers it has no business with.

This change assigns both handlers to RemoteDocPresence.prototype where they belong.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Fixes #708

At the moment, `_handleCreateDel` and `_handleLoad` are assigned to
`RemotePresence.prototype` rather than `RemoteDocPresence.prototype`.

`RemotePresence` is the base class, and `RemoteDocPresence` is the only
subclass, so these handlers still happen to be reachable via the
prototype chain and the bug is invisible in practice. However, defining
them on the base prototype pollutes it, and any future sibling subclass
would silently inherit doc-specific presence handlers it has no business
with.

This change assigns both handlers to `RemoteDocPresence.prototype` where
they belong.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.467%. remained the same — fix-remote-doc-presence-prototype-mutation into master

@alecgibson alecgibson marked this pull request as ready for review July 6, 2026 08:27
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.

RemoteDocPresence mutates the prototype of RemotePresence

2 participants