Skip to content

Look at every story for deltas, and say which it couldn't - #112

Merged
nedtwigg merged 3 commits into
mainfrom
delta-scan-failures
Nov 30, 2026
Merged

nedtwigg merged 3 commits into
mainfrom
delta-scan-failures

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

Step 0 of docs/plans/diffs.md (#111): fix the two bugs that left 34 of PR #108's 143 stories out of the repeated changes offered, signed in on app.selfie.dev, while the progress bar said done.

The Worker only asks who's asking where that's used

Every review request with a session cookie called login.writerOf, which asks the Better Auth adapter's /list-accounts, and that's rate limited. The batch page's delta scan makes a diff request and two image requests per changed story, so past about 100 the adapter answered 429, writerOf threw, and those requests 500'd.

  • hostedReviewSource now takes actor as () => Promise<string | null>, and only batchView and decide call it. Images, diffs, and every other read never reach the adapter. The ReviewSource seam is unchanged, so selfie ui is untouched.
  • A workerd test sends a session the adapter fails on: the batch view 500s, and an image, a diff, and a diff image are all 200.

The delta scan doesn't drop stories without a word

  • workThrough in ui/src/client/deltas.ts replaces part()'s .catch(() => undefined). It tries a 429, a 5xx, or no answer again, twice more, after 0.5 s and then 2 s, and gives back whatever never worked. RequestError carries the HTTP status, and image fetches go through the same fetchImage in api.ts.
  • The scan counts the stories it couldn't look at. The batch page shows a warning banner over the repeated changes ("Couldn't look at 34 changed stories"), with a Look again button. Another visit only re-decodes for deltas if something new got scanned, or some images couldn't be decoded last time.
  • New story: BatchScreen → RepeatedChangesNotAllLookedAt. Tests in ui/test/delta-scan.test.ts.

In the cloud, a pair nobody pushed a diff for answers 404, so it's never retried, but it is counted. The banner says so, rather than leaving that story out of every delta without a word. Step 4 of the plan removes that case.

Specs

  • docs/specs/access.md → Who can do what: ask the adapter only for a batch's view and a decision (rationale added).
  • docs/specs/ui.md → Screens → Repeated changes: try again, then say how many it couldn't look at (rationale added).

The cause hasn't been checked against the Worker's logs. It's what the code and Better Auth's default limit (100 per 10 s per IP) predict.

🤖 Generated with Claude Code

nedtwigg and others added 2 commits November 30, 2026 02:00
Signed in on the cloud, every review request asked the auth adapter who was
asking, so a batch page's delta scan, a diff and two images per changed story,
ran into Better Auth's rate limit, and the scan dropped whatever failed without
a word. Only the batch view and a decision ask now. The scan tries a 429, a 5xx,
or a dropped connection again, and the batch page says how many changed stories
it still couldn't look at, with a way to look again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as no diff

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pixel hash mismatch is a failure the scan counts, and never tries again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nedtwigg
nedtwigg merged commit 08f69fe into main Nov 30, 2026
5 checks passed
@nedtwigg
nedtwigg deleted the delta-scan-failures branch November 30, 2026 11:04
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.

2 participants