-
v4.0.2
Stablereleased this
2026-08-22 13:58:54 +00:00 | 1 commits to main since this releaseA one-fix patch release: a connection the consumer closed no longer handles frames. No API
changed, so upgrading is the dependency URL.Bug fixes
- A closed connection still handled frames -
db:close()stopped the sends but not the
receives, and handling one frame wrote_stateback to"connected", re-persisted the
identity and token to the save slot, re-emittedconnectedtoon_eventandon_connect, and
refilled the row cache. A UI that tore down on"closed"could be told it was connected again,
to a socket nobody asked to keep. Reachable on HTML5, and only there in a real program:
extension-websocket 4.2.4'sCloseConnectiongates its whole body onSTATE_CONNECTED, and
the unconditional transition toSTATE_DISCONNECTEDis compiled only underHAVE_WSLAY, so a
close()during the handshake is a genuine no-op on that target - the browser still fires
onopenand the server's frames keep coming for as long as the page lives. Native was never
affected on this path, sinceCloseConnectiondoes transition there.connection.dispatchnow
refuses any frame on a closed connection
(#115). - Post-close frames retained by the
frame_budgetqueue - thedispatchguard alone sits
downstream of the budgeted queue, andclose()cancels the pump without restarting it, so
every post-close frame was retained for the life of the page - roughly 4 MB per 200,000 frames.
TheEVENT_MESSAGEbranch instdb/init.luanow drops earlier still, before the queue, the
coroutine and the decode. db:state()is terminal at"closed"- with frames dropped at both layers, nothing moves
the state off"closed", which is the propertydb:state()'s own documentation already
claimed and is now documented as terminal. Teardown code on"closed"no longer has to defend
against a laterconnected, and the two send-path guards the pre-open hold added in v4.0.1
collapse to that single sticky test.
What's Changed
Full Changelog: v4.0.1...v4.0.2
Use as a Defold library
Add to
game.projectdependencies:https://git.nokopia.com/yuris/spacetimedb-defold/archive/v4.0.2.zip https://github.com/defold/extension-websocket/archive/refs/tags/4.2.4.zipextension-websocket is required: Defold does not resolve dependencies
transitively, so without itconnectfails at runtime.Private repo? Append
?token=<access-token>to the URL, the same
shape Defold documents for GitLab. Basic auth in the URL
(https://user:token@...) is not a substitute: the archive endpoint
ignores URL credentials - a real account with a wrong password still
gets200on a public repo - while?token=is validated and a bad
one gets a plain401.Downloads
-
Source code (ZIP)
2 downloads
-
Source code (TAR.GZ)
1 download
- A closed connection still handled frames -