Commit caa949e
committed
feat(sdk): bridge user-presence streamer onto DDPSDK listener
The client/lib/presence.ts subscribe already routes through DDPSDK when
the SDK is authenticated, but app/notifications/client/lib/Presence.ts
was still registering streamerCentral against Meteor.connection only.
That meant user-presence stream-changed frames arrived on the DDPSDK
socket while the listener was wired to Meteor — the UI would miss
status updates whenever the subscribe path picked DDPSDK.
Add a thin DDPSDK → StreamerDDPConnection adapter (createDdpSdkStreamerAdapter)
that exposes a compatible _stream.on('message', ...) surface by
re-serialising DDPSDK's parsed payloads with EJSON so StreamerCentral's
JSON-parse path round-trips dates identically to the raw Meteor frames.
Call streamerCentral.setupDdpConnection a second time with the adapter:
StreamerCentral tracks registration per connection object via
hasMeteorStreamerEventListeners, so both transports get a listener and
the streamerCentral emitter fires once per frame regardless of which
socket delivered it.1 parent eeeb957 commit caa949e
2 files changed
Lines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
10 | 18 | | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments