Split out of #24, whose items 1 and 2 stay there because they change the download path. This issue takes items 3 to 9: the retry classifier and the retrying API client entry points. The original wording of each item is in #24 and its two comments.
Where things are (branch next2)
src/retry.ts: TRANSPORT_CODES (line 51), CONNECT_CODES (80), MAX_CAUSE_DEPTH (85, walked at 95), and isSafeToReplay (166), which reduces the cause chain with .some().
src/api/client.ts: getRetryOptions (145) returns the internal object. There are per-attempt AbortSignal.timeout calls in each entry point. The idempotency comments are at 227, 274 and 302.
README.md:379-395: the idempotency section.
Definition of done
Item 3: every errno in TRANSPORT_CODES and CONNECT_CODES has a test pinning which side it falls on.
Item 4: every retrying entry point (postJSON, putJSON, putFile, getFileStream, getThumbnailStream, plus getJSON, already done) has a test proving attempt N+1 gets a fresh deadline.
Item 5: getRetryOptions() returns a copy, or a frozen object. A test proves a caller cannot change the client's settings.
Item 6: tests pin the depth limit and prove a cyclic cause chain terminates.
Item 7: the list of endpoints the replay rule covers is stated once. The other place points to it.
Item 8: postJSON and putJSON use redirect: "manual", and a redirect is treated as an error, not replayed. A test covers this.
Item 9: isSafeToReplay matches its "when in doubt, do not replay" rule. A chain containing any error that shows the request went out is not replayable. A test pins this.
Each fix has a test that fails when the fix is reverted. No test depends on wall-clock time. make check green. TODO.md updated in the same commit.
Out of scope: download deadlines and stream cancellation, which stay in #24.
Model: opus-5-5
Split out of https://git.eeqj.de/sneak/quak/issues/24, whose items 1 and 2 stay there because they change the download path. This issue takes items 3 to 9: the retry classifier and the retrying API client entry points. The original wording of each item is in https://git.eeqj.de/sneak/quak/issues/24 and its two comments.
## Where things are (branch `next2`)
- `src/retry.ts`: `TRANSPORT_CODES` (line 51), `CONNECT_CODES` (80), `MAX_CAUSE_DEPTH` (85, walked at 95), and `isSafeToReplay` (166), which reduces the cause chain with `.some()`.
- `src/api/client.ts`: `getRetryOptions` (145) returns the internal object. There are per-attempt `AbortSignal.timeout` calls in each entry point. The idempotency comments are at 227, 274 and 302.
- `README.md:379-395`: the idempotency section.
## Definition of done
1. Item 3: every errno in `TRANSPORT_CODES` and `CONNECT_CODES` has a test pinning which side it falls on.
2. Item 4: every retrying entry point (`postJSON`, `putJSON`, `putFile`, `getFileStream`, `getThumbnailStream`, plus `getJSON`, already done) has a test proving attempt N+1 gets a fresh deadline.
3. Item 5: `getRetryOptions()` returns a copy, or a frozen object. A test proves a caller cannot change the client's settings.
4. Item 6: tests pin the depth limit and prove a cyclic `cause` chain terminates.
5. Item 7: the list of endpoints the replay rule covers is stated once. The other place points to it.
6. Item 8: `postJSON` and `putJSON` use `redirect: "manual"`, and a redirect is treated as an error, not replayed. A test covers this.
7. Item 9: `isSafeToReplay` matches its "when in doubt, do not replay" rule. A chain containing any error that shows the request went out is not replayable. A test pins this.
8. Each fix has a test that fails when the fix is reverted. No test depends on wall-clock time. `make check` green. `TODO.md` updated in the same commit.
Out of scope: download deadlines and stream cancellation, which stay in https://git.eeqj.de/sneak/quak/issues/24.
Model: opus-5-5
Implemented in #83 (base next2). All seven items are fixed or pinned by tests. The PR body has the details.
Model: opus-5-5
Implemented in https://git.eeqj.de/sneak/quak/pulls/83 (base `next2`). All seven items are fixed or pinned by tests. The PR body has the details.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Split out of #24, whose items 1 and 2 stay there because they change the download path. This issue takes items 3 to 9: the retry classifier and the retrying API client entry points. The original wording of each item is in #24 and its two comments.
Where things are (branch
next2)src/retry.ts:TRANSPORT_CODES(line 51),CONNECT_CODES(80),MAX_CAUSE_DEPTH(85, walked at 95), andisSafeToReplay(166), which reduces the cause chain with.some().src/api/client.ts:getRetryOptions(145) returns the internal object. There are per-attemptAbortSignal.timeoutcalls in each entry point. The idempotency comments are at 227, 274 and 302.README.md:379-395: the idempotency section.Definition of done
TRANSPORT_CODESandCONNECT_CODEShas a test pinning which side it falls on.postJSON,putJSON,putFile,getFileStream,getThumbnailStream, plusgetJSON, already done) has a test proving attempt N+1 gets a fresh deadline.getRetryOptions()returns a copy, or a frozen object. A test proves a caller cannot change the client's settings.causechain terminates.postJSONandputJSONuseredirect: "manual", and a redirect is treated as an error, not replayed. A test covers this.isSafeToReplaymatches its "when in doubt, do not replay" rule. A chain containing any error that shows the request went out is not replayable. A test pins this.make checkgreen.TODO.mdupdated in the same commit.Out of scope: download deadlines and stream cancellation, which stay in #24.
Model: opus-5-5
Implemented in #83 (base
next2). All seven items are fixed or pinned by tests. The PR body has the details.Model: opus-5-5