Skip to content

Tell the user when the helper is older than the extension - #11

Merged
agkloop merged 2 commits into
mainfrom
feat/helper-version
Sep 20, 2026
Merged

agkloop merged 2 commits into
mainfrom
feat/helper-version

Conversation

@agkloop

@agkloop agkloop commented Sep 20, 2026

Copy link
Copy Markdown
Owner

What

The extension and the helper are installed separately (reload in Chrome; install.sh). When the extension relies on something an older helper does not do, the result was an odd failure somewhere later.

  • Helper: answers hello with { proto: protoVersion } (host/host.go).
  • Service worker: asks on every new connection to the helper and compares with NEED_PROTO. A helper from before the question existed answers "unknown request type": that counts as 0. No answer at all (timeout, dead port) is a different problem and is left to the existing error handling.
  • Popup: on { type: 'helper', outdated: true } the status line says "The helper is older than this extension. Run install.sh again to update it."

Both sides start at version 1, so nothing is reported today. The number goes up with the first change that needs it. #8 (warm) and #10 (tracks) do not need a bump: an older helper fails those quietly (no pre-connect; no track list, so no pickers).

Stacked on #9

This branch sits on top of chore/ci, because it changes that pull request's service worker test: the test looked for the cast request at posted[0], and the hello is sent first now, so it finds the cast by type. Merge #9 first; until then this diff also shows #9's commit.

Testing

  • go vet, go test -race (hello checked in TestNativeFraming)
  • node --test: 7 pass. New case: a current helper is not reported; "unknown request type" and proto: 0 are
  • Not tried against an actually older installed helper

🤖 Generated with Claude Code

agkloop and others added 2 commits September 20, 2026 18:37
Nothing checked a change before it was merged: vet, the Go tests and
the rest ran when someone remembered to. A workflow now runs them on
every pull request and on main. The helper job runs on macOS, the only
system the helper ships for (it builds for Linux as well, not for
Windows): go vet, the tests under the race detector, staticcheck and
govulncheck. Both linters are clean today, so both block. The extension
job syntax-checks every script, parses the manifest and runs the new
test. The workflow may read the repository and nothing else, and a
newer push cancels the run it supersedes.

The parsers that read bytes chosen by someone else get native fuzz
targets: the HLS rewriter and the playlist scan (any web server; the
DASH rewriter's target comes with its rewrite in the relay security
change), the mDNS parser, the Cast frame reader, its message decoder
and the check of the auth reply (any machine on the LAN), and the
native-messaging reader (the browser). Each asserts only that the
parser returns, without panicking, and keeps to the limits it
documents. Their seeds run with go test; 20 s of fuzzing each found
nothing. The native-messaging target holds every handler slot while it
runs, so a well-formed request is answered BUSY and never acted on: a
fuzzer must not be able to start a real scan or cast.

sw.js gets its first test. node:test runs it in a vm context with a
stub chrome object, plays the helper and checks what the popup is told:
media reports are dated, the duration is carried forward (and 0 is a
value, not a gap), a disconnect clears it, a final IDLE ends the cast,
and senders other than our own pages get no answer. No dependencies,
so there is still no package.json.

.gitignore now covers host/host, the binary a bare `go build` leaves
behind.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The extension and the helper are installed separately: one is reloaded in
Chrome, the other comes from install.sh. When the extension starts to rely
on something a helper built before does not do, the result was an odd
failure somewhere later.

The helper now answers a hello request with its protocol version. The
service worker asks on every new connection to the helper and compares
with what it needs. A helper from before the question existed answers
"unknown request type", which counts as version 0. No answer at all (a
timeout, a port that died) is a different problem and is left to the
error handling that already exists. When the helper is behind, the popup
says: "The helper is older than this extension. Run install.sh again to
update it."

Both sides start at version 1, so nothing is reported today. The number
goes up with the first change that needs it.

The service worker test looked for the cast request at posted[0]; the
hello is sent first now, so it finds the cast by its type.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@agkloop
agkloop merged commit d80d805 into main Sep 20, 2026
3 checks passed
@agkloop agkloop mentioned this pull request Sep 20, 2026
1 task
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