Repository navigation
Conversation
|
Thanks @Brumbelow -- and thanks for keeping this in lockstep with the CLI side. Merging Two questions before I merge, both about coverage rather than the code. What did the Playwright run exercise?The CLI e2e suite defaults to Did you serve this branch's assets and point the suite at them? "Coordinated" reads like you If you didn't, no biggee: it's the one gap I'd want closed before merge, since
|
|
No — that run was unmodified, so it proved the downgrade path from a v4 connector and none of this branch's browser code ran. Now closed: the same suite against this branch served locally passes 10/10, with the browser reporting Added the workflow here rather than leaving it to a follow-up: |
|
Pushed — |
|
Hi Brumbelow, my apologies for the wait on this. I'd been focusing on the CLI repo and more or less forgot about this repo, even though it's arguably more important! Everything I asked for is here: One thing blocks, one is a follow-up. Uploads get a wall-clock deadline they deliberately did not have
if (!hasBody) {
timeout = setTimeout(() => { ... }, 30000);
}An upload takes as long as it takes. The new const uploadAcks = new SWSPUpload.AckGate(30000);
...
const ack = uploadAcks.wait(seq);
channel.port1.postMessage({ type: 'bodyChunk', data: chunk, seq }, [chunk.buffer]);
await ack;The ack is not local. On The fix I would suggest is not a bigger number -- it is that the timer The workflow could take the Go tests tooNot a blocker, and adding CI at all was already more than I asked for. But Checked and cleanFor the record, since some of this was the thing I was worried about:
One deployment note, for me rather than you
|
A slice waited at most 30 s for its acknowledgement, and bootstrap.js re-armed its request timer per slice, so an upload under ~280 kbit/s failed where main completed. Neither timer touches a body now. A request whose body was empty is timed like a GET once its FIN is out; the reap after an early answer waits for the body as well; and an answer that is already complete survives the stream reset that can follow it.
581d7f3 to
0aced14
Compare
|
Pushed. Dropped the deadline rather than moving it. The CLI's reserveSend has none either, and with credit arriving per half-window a stall timer keyed on it would still fail anything under ~140 kbit/s. bootstrap.js's own 30 s request timer had the same per-slice reset, so it now runs only once the whole request is out: for a GET as before, and for a POST with nothing in it. The 30 s reap after an early response now waits for the body as well, and an answer that arrives before the upload is done is delivered rather than lost to the stream reset that follows it (the listener drops the body pipe once it has responded; that 'read/write on closed pipe' reset is a CLI-side race I'll follow up on). A dead peer still surfaces through the channel closing. Go tests: ci.yml from #2 already runs go vet and go test ./... on every PR and push, so I left tests.yml to the web side. Rebased onto main while in there: the bench stream opens and consumes credit like the others, the Firefox buffered body goes through the same slice/ack loop, and the two new scripts are in stampInputs. Checked with the CLI suite against this branch's assets plus a 3 MiB upload into a 16 KiB/s sink, credit-bound from the second slice on: it died at the 30 s mark before the change and completes after it. |
Summary
node --checkon the browser scripts,node --testonweb_test/Motivation
This is the browser-side companion for richlegrand/bitbang-cli#14. A single slow consumer could previously let one stream monopolize the shared data-channel receive path or accumulate unbounded listener-side work.
SWSP v4 adds cumulative per-stream window updates and stream-local resets. These controls are enabled only after explicit negotiation, so existing listeners continue to use the legacy wire behavior.
Testing
go test -count=1 ./...go vet ./...go build ./...node --test web_test/flow-control.test.js web_test/sw-upload.test.jsnode --checkfor the updated browser and service-worker scriptstest.bitba.ng(v3 assets): 10 passed. This exercises only the downgrade path from a v4 connector — none of this branch's browser code runs.negotiatedVersion: 4(checked viawindow.__bitbangConnection). Recipe:go run ./cmd/signalingfrom this branch'sbitbang-server/— serves./webon :8082~/.pki/nssdbwithcertutil) — the CLI always dialswss://bitbang-cli:BITBANG_TEST_SERVER=localhost:8443 BITBANG_BIN=<bitbang built from bitbang-cli main, which includes #15> python -m pytest tests/e2e/Companion PR