From 78a0df858a6d98df922f5ec0fa33add96f33741e Mon Sep 17 00:00:00 2001 From: Alec Gibson <12036746+alecgibson@users.noreply.github.com> Date: Mon, 6 Jul 2026 08:44:48 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Assign=20presence=20handlers=20t?= =?UTF-8?q?o=20`RemoteDocPresence`=20prototype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/share/sharedb/issues/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 --- lib/client/presence/remote-doc-presence.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client/presence/remote-doc-presence.js b/lib/client/presence/remote-doc-presence.js index 0f3b7f74c..6c3e938d7 100644 --- a/lib/client/presence/remote-doc-presence.js +++ b/lib/client/presence/remote-doc-presence.js @@ -76,12 +76,12 @@ RemoteDocPresence.prototype._handleOp = function(op, source, connectionId) { this._setPendingPresence(); }; -RemotePresence.prototype._handleCreateDel = function() { +RemoteDocPresence.prototype._handleCreateDel = function() { this._cacheOp(null); this._setPendingPresence(); }; -RemotePresence.prototype._handleLoad = function() { +RemoteDocPresence.prototype._handleLoad = function() { this.value = null; this._pending = null; this._opCache = null;