Public: anyone can read this; the crew can change it.

Looks that work well: a failed picture is retried, a sleeping app says so, a card says why it has no picture, and the thumbs are the ones the owner would choose #1359

Closed opened this in answer to
Closed without merging

Failed pictures are now retried, and a capture that lands on a sign-in page or a browser error page counts as a failed look. I couldn't run the server-backed tests here, so the new cases in test/looks.test.ts and the updated test/front.test.ts are unrun.

Notes

stopped closed without shipping

opened this

Failed pictures are now retried, and a capture that lands on a sign-in page or a browser error page counts as a failed look. I couldn't run the server-backed tests here, so the new cases in test/looks.test.ts and the updated test/front.test.ts are unrun. The sandbox refuses the unix-socket listen those suites need (EPERM), so please watch the forge check. tsc passes, and so do test/looks-reasons.test.ts and test/schema-migrations.test.ts.

What changed

  • Retry: a failed look is retried after 5 minutes, then 10, 20 and so on, up to a day. The count is a new look.attempts column (migration 73). The sweep retries when the machine is quiet, using the existing memory-pressure wait.
  • Walking the road first: new src/looks/preflight.ts makes the same journey the browser would, over the forge's own listener, before any browser starts. A hop to another host, a 404 ("not serving"), the forge's sign-in or a "Privacy error" page records a failed look with that reason, and no browser is started.
  • Browser can't leave the forge: Chromium now resolves only the app's host and loopback, so a stray hop to git.open-platform.sh fails outright.
  • Who the picture is taken as:
    • A thumb of an app that isn't public is now taken as the owner. As nobody it was a sign-in page.
    • Any picture taken as the wrong viewer is retaken. This happens on the next sweep, or at once when the app's settings change (app.updated queues it).
    • A failed retake never replaces a good picture.
  • Stale and blank: a production thumb older than a week is retaken, and the old one stays up if the retake fails. A first paint that is one flat colour is waited on (3 s, then 9 s) and taken again.
  • Cards without a picture: a tile with no picture shows the app's name on a calm ground plus a one-line reason (lookReason). The featured card says "No picture: …". Reasons are fixed phrases: "taking a picture", "not serving", "failed; retrying at 20:40 UTC", "pictures are the writers' on this private app". The browser's error text is never shown to a stranger.

What I changed in existing tests

  • test/looks.test.ts asserted that the thumb of the private hello app is taken as nobody. That is the behaviour that caused the bug, so I changed those assertions to expect the owner.
  • startLooks in test/looks.test.ts and test/front.test.ts now gets a stub preflight.

What I left out

  • Thumb size: the thumb is still a 1280×800 page reduced to 640×400, which is 2x for a 320px tile. I didn't tie it to the card's real width.
  • Pictureless shelf tiles: frontPage still filters out shelf entries that have no picture (the "never a letter tile" test), so the calm-ground tile only appears if that rule is relaxed. Today the visible change is on the featured card.

Try it: bun test test/looks-reasons.test.ts covers the retry schedule, the staleness rule, the reason lines, the road walk, blank detection and the card rendering. The scenario tests are in test/looks.test.ts: retry on schedule, stale retake, a failed retake keeping the picture, skipping a non-serving app, and an access change retaking the thumb.

🤖 Generated with Claude Code

Closes #1150

commented

The check failed because src/core/schema.ts conflicted with main. I fixed it and pushed, but I haven't seen a passing test run. Most of the suite can't start a server in this sandbox, so the forge's check is the first real run.

What changed

  • I merged main into the branch.
  • Both branches had added a migration numbered 73. main's OAuth authorization codes table (oauth_code) keeps 73. The look attempts column from this pull is now 74, so the retry back-off still works.

What the tests showed

  • Running bun test gave 1278 pass and 527 fail. The failures I looked at are EPERM on socket listen in this sandbox. In test/looks.test.ts that fails the setup in beforeAll, so the later looks.stop failure follows from it.
  • I did not check the other failures one by one.
  • I made no change to any test.

How to try it Open the preview at https://lab--1359--forge-trevato-apps.open-platform.sh after the check passes.

commented

Parked by the crew: the check failed ("the look > a failed picture is retried on a doubling schedule, a thumb a week old is retaken, a failed retake keeps the picture, and an app that is not serving is skipped with its reason (#1150)") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs