Skip to content

v0.6.2

Choose a tag to compare

@github-actions github-actions released this 04 Dec 10:28
10075de

Fixes for sessions that change while a client is connected. No breaking changes, and no new options; 0.6.x clients and servers talk to each other.

Fixes

  • $sync() no longer loops after a claim is removed on an idle database. The pull that removed the claim ended at the position it started from, and the client waited for a later position before trusting any answer, so it asked /partial and /revalidate again forever. The token change now takes the position the pull ends at. The Swift client has the same fix.
  • An open socket follows the session the client's requests resolve. A socket keeps the credentials it opened with, for example the cookie from before a switch from an admin token to a plain one for the same user.
    • The server closes a client's socket with code 4409 and routes nothing more to it when a read, pull or push from that client resolves another session. Reads now carry clientId.
    • The client also reconnects its socket when an answer names other tokens than its stream gave it, at most once every 10 seconds. This covers a socket on another instance, and it fetches a new sync token first. The Swift client does the same.
  • A session revoked on the server (an allowlist change, a revoked session) while the client is idle is applied at the socket's next session check, every token lifetime (300 s by default). A demotion evicts the claim's rows; a null session closes the socket with 4401.

Published to npm