fix(server): wrap awareness origin as TransactionOrigin (#1094)
* fix(server): wrap awareness origin as TransactionOrigin
The v4 awareness listener in Hocuspocus.ts uses isTransactionOrigin to
read payload.connection, but MessageReceiver and
Document.applyAwarenessUpdate pass the raw Connection, so the guard
fails and payload.connection is always undefined.
Mirror the sync-handler pattern in the same file: wrap origin as
{ source: 'connection', connection } at the producer sites, extract
via the type guard in Document.handleAwarenessUpdate, and tighten the
related parameter types so future producers cannot regress.
Soft API break: listeners attached directly via
document.awareness.on('update', ...) now receive a TransactionOrigin
instead of a raw Connection. The recommended onAwarenessUpdate hook
keeps exposing the resolved connection via payload.connection.
* test(server): assert onAwarenessUpdate forwards the originating connection D
Dominik Schmidt committed
bb24de0ffb944e10845174e26971eaa95b2db675
Parent: 3fb1c63
Committed by GitHub <noreply@github.com>
on 5/18/2026, 7:23:24 AM