Skip to content

No-ping timer, subscribe position order, delta without base - #106

Merged
FZambia merged 3 commits into
masterfrom
fuzz_fixes
Oct 14, 2026
Merged

FZambia merged 3 commits into
masterfrom
fuzz_fixes

Conversation

@FZambia

@FZambia FZambia commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes found while running the SDK fuzz programs and reviewing delta compression against centrifuge-js and the server.

  • Don't wait for server pings when the server sends none. When the server has pings disabled, the client still armed its no-ping timer. It then ended every connection with "no ping" and reconnected, indefinitely. The timer is now armed only when the server pings.
  • Store the subscribe position before the subscribed event. If the handler threw, the position the event reported was lost, and the next recovery started from an older position. The application then received publications from before its subscription. The position is now stored before the event, as in centrifuge-js.
  • Treat a delta publication without a base as a protocol error. Such a delta used to be delivered as the payload and kept as the base. It now stops the client with bad protocol, as in centrifuge-js. The base is also now a copy of the delivered data, so an app that changes getData() in place doesn't break the next delta.

A server with pings disabled sends no ping interval in the connect reply.
The client armed its no-ping timer anyway, with only maxServerPingDelay,
so it ended every connection with "no ping" and reconnected, for good.
The timer is now armed only when the server pings, as in other SDKs.
The position of a subscribe reply was stored after the subscribed event.
A handler that throws stops the client before anything after the event
runs, so the position the event reported was lost, and the next recovery
started from an older one: the application received publications from
before its subscription. The position is now stored before the event, as
in centrifuge-js; after a recovery it is the position recovered from, which
the recovered publications move as before.
A delta that arrived with no base was delivered as the payload and kept as
the base. As in centrifuge-js it now stops the client with bad protocol.
The base is also a copy of the delivered data, so an app changing the data
in place does not break the next delta.
@FZambia
FZambia merged commit 5582dcf into master Oct 14, 2026
12 checks passed
@FZambia
FZambia deleted the fuzz_fixes branch October 14, 2026 17:07
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