Skip to content

v3.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 09 Nov 23:28
7738add
  • A handler that keeps throwing can no longer stall a player's events or end the session. A rejected event is now
    offered at most events.maxRejections times (default 10, about a second), then dropped and acknowledged, so the
    events behind it continue in order. If the queue behind it fills first, it gets one last offer and is then dropped,
    instead of the session being closed with Event sequence gap. stats.eventsDropped counts these and onError
    reports each one. An ack can now also mean the receiver gave up on the event. This changes the previous "offered
    until accepted" behavior: a handler that throws to wait for something slower than a second should set
    maxRejections: Infinity, which keeps the old behavior, including session loss on a full queue.
  • Extra copies of a rejected event, such as its datagram mirror, wait for the 100 ms retry delay and no longer count
    as attempts. Code using ReliableEvents directly must call drain to retry a rejected event.
  • The rejected-event change above needs no wire change and is local to the receiving end.
  • A resumed welcome now carries the server's event counters (r received, a acknowledged). These fields are
    additive and wire generation 5 is unchanged: older clients ignore them, and a client talking to an older server
    resumes as before, so either side can upgrade first.
  • Fix resuming from a checkpoint older than the last event. The old page's later events made the server's ack look
    invalid, and the session was lost with protocol. Now the client lines up with the server before it sends anything.
    Events queued since the restore move past what the server already has, so they are no longer dropped as duplicates.
    Server events the checkpoint never saw and the server has since forgotten are skipped and reported through
    onError, so the events behind them still arrive. sendEvent's returned sequence number can change for such a
    queued event.
  • A throw or rejected promise from authenticate is now a temporary failure: the socket closes with 1013, the client
    retries, and the session and its seat are kept. Returning null still ends the session. Applies to the Worker
    adapter too.
  • Fix a player kicked while a resume awaited iceServers staying online on a removed session. The client now gets a
    session-unavailable close (4001).
  • Fix a new session being expired during an async iceServers once the server had been up longer than
    resumeGraceMs, which left that player online but never pumped. A new session abandoned during that wait now frees
    its slot at once.