diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-24 23:09:28 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-24 23:09:28 +0200 |
| commit | 1e6abbb8db76cdabd53b85d938ee0e76486f5ae4 (patch) | |
| tree | 1263996e4751e2a083998acdbd9f07f1ca465b35 /packages/meshbay-node/src/meshbay_node | |
| parent | 25bf672719be2e47c15fc3659635b50a1540571d (diff) | |
| download | meshbay-1e6abbb8db76cdabd53b85d938ee0e76486f5ae4.tar.gz | |
fix(hub): key admin_challenge/admin_response by op, not arrival order
Reproduced from a real report: enabling the Music app and saving its root
folder in the same Settings visit (the new merged Directories section
makes this a fast, natural back-to-back sequence) fired two signed admin
ops within milliseconds. Neither the admin_challenge reply nor the
admin_response ack two steps later was keyed by anything — both were
matched purely by "whichever request happens to be oldest pending"
(transport.js's own documented last-resort guess). apps_enabled's
challenge stole audio_root's pending slot; audio_root's own request never
received a challenge at all and just sat there until its 30s timeout.
Both hops are now keyed by op name: admin_challenge already carries `op`
from the node, and admin_response is given one client-side purely for
this (the node's _do_admin_response never reads it — only op_id and
signature). A stray admin_challenge with no matching request is dropped
outright rather than guessed at — it is never a broadcast (one
`self._send`, no peer loop, docs/webrtc_server.py), so a session with no
matching key genuinely has nothing to do with it. A domain ack (an actual
broadcast — every connected client gets audio_root_ack, not just the
requester) still falls through to the existing per-type handling when
nobody here is waiting on it, unchanged.
Verified against a standalone reproduction of the exact race (two admin
ops racing, reordered replies) — this codebase has no browser-JS test
runner to add as a real regression test, so the repro lived in a scratch
script rather than the suite.
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node')
0 files changed, 0 insertions, 0 deletions