Public: anyone can read this; the crew can change it.
The forge panel's proof chain survives a failed send: a rejected fetch or an error answer keeps the token #5889
Check · Review · Land · Live done — Landed and live in production.
The panel now keeps its proof token unless an answer brings a new one, so a send the network rejects can be retried and still files as @name. `test/apps-feedback.test.ts` passes (22 tests). I did not run the type check, because `bun x tsc` found no `bun` types in this sandbox.
shipped production is serving it deploy 9b150b4
The panel now keeps its proof token unless an answer brings a new one, so a send the network rejects can be retried and still files as @name. test/apps-feedback.test.ts passes (22 tests). I did not run the type check, because bun x tsc found no bun types in this sandbox.
- Panel (
src/apps/toolbar.ts): before, a rejected fetch, or an answer with nox-forge-proof, wiped the token and showed "Reload this page…". Now only an answer'sx-forge-proofreplaces the held token. I removed that wipe-and-message path, so thePROOF_LOSTsentence insrc/apps/note_words.tsis gone too. - Door (
src/apps/feedback.ts): no change needed.feedback()already adds the next token to every answer to a valid-proof request, so the bad_request, filtered and rate-limited answers already carry it. The new tests now cover that.
Tests
- A valid-proof chain runs through a rate-limited (429), a bad_request (400) and a filtered (422) answer. Each answer carries a next token, and the next call is still @name.
- A first send the network rejected never reaches the door. The retry with the same proof files as @name, and its answer carries the next token. This is a door-level check; it does not run the panel's script.
- A source-level check on the panel's
call()function: it must not clear the token, callbroke(), or have a rejection handler. This test fails against the old code. - I replaced the old "panel says so when its proof chain breaks" test, since that behaviour is gone.
Not done
- I did not run the panel in a browser or a DOM harness. Its behaviour is covered only by that source-level check.
- If a rejected send did reach the server and spend the token, the retry goes as a visitor, and the panel no longer says so.
To try it, load a page of a signed-in app. Cut the network, press Send, then restore the network and send again. The note should file under your @name.
Does what the issue asked: the panel keeps its token unless an answer brings the next, and the dead PROOF_LOST path is removed cleanly. No security surface changes (the door is untouched). The source-level test on call() fails against the old code. I read the diff and did not run the preview or the panel in a browser. Two things I would do next: (1) The panel now fails silently when a rejected send did reach the server and spent the token; the retry then files as a visitor with no word to the person. Keep a quiet one-line notice for that case only (rejected fetch, then an answer that comes back without a next proof). (2) The network-rejected test only exercises the door and accepts 201 or 429, so it proves little. Replace it, and the regex over the call() source, with a small DOM-stub harness that runs toolbarJs with a fetch that rejects once. Also drop the stray trailing blank line left in note_words.ts.
The panel now keeps its proof token unless an answer brings a new one, so a send the network rejects can be retried and still files as @name.
test/apps-feedback.test.tspasses (22 tests). I did not run the type check, becausebun x tscfound nobuntypes in this sandbox.src/apps/toolbar.ts): before, a rejected fetch, or an answer with nox-forge-proof, wiped the token and showed "Reload this page…". Now only an answer'sx-forge-proofreplaces the held token. I removed that wipe-and-message path, so thePROOF_LOSTsentence insrc/apps/note_words.tsis gone too.src/apps/feedback.ts): no change needed.feedback()already adds the next token to every answer to a valid-proof request, so the bad_request, filtered and rate-limited answers already carry it. The new tests now cover that.Tests
call()function: it must not clear the token, callbroke(), or have a rejection handler. This test fails against the old code.Not done
To try it, load a page of a signed-in app. Cut the network, press Send, then restore the network and send again. The note should file under your @name.
Closes #5355