Skip to content

Issue-184: Offer Build it when only the frames request failed - #235

Merged
ronisahajoo merged 3 commits into
devfrom
fix/184-offline-build-it
Nov 30, 2026
Merged

ronisahajoo merged 3 commits into
devfrom
fix/184-offline-build-it

Conversation

@ronisahajoo

Copy link
Copy Markdown
Collaborator

Closes #184

Problem

Offline (SX_OFFLINE=1), an object whose SPHEREx frame list is not cached answers 503 offline_cache_miss. The Flipbook's error state had no Build it button, so a demo-pack object that resolved fine could not be built from the panel.

Change

  • Flipbook.tsx: the error state shows the existing Build it button under the error when the object resolved, so only the frames request failed. This also covers other frames errors, not only offline ones.
  • Flipbook.test.tsx (new): the button shows in that case, and not when the object did not resolve or there is nothing to build.
  • demoPackOffline.spec.ts: back from test.fixme to test. afterAll now kills the whole process tree, so no uvicorn stays on port 8791.
  • frontend.yml: the e2e job installs uv (same pin as backend.yml) and runs uv sync --locked.
  • testing.md: records the spec and the new CI step.

The workflow and docs edits are outside frontend/src/app/flipbook/; the issue's checklist needs them.

Testing

  • demoPackOffline.spec.ts passes locally on Windows (1/1). No server was left listening on port 8791.
  • Manual check against the offline backend with the frame lists removed: Build it shows and the 3D view builds.
  • typecheck passes; lint has no errors (existing warnings only).
  • npm test: 3391 passed, 4 failed, none in files changed here. Three in flyHeight.test.ts also fail without this change. One in fileNameCase.test.ts flags starCloseUp.ts / StarCloseUp.tsx, apparently because its allow list does not match Windows backslashes.
  • Not run: the other e2e specs. The new CI step has its first run on this PR.

Note

The frontend CI path filter does not cover all of backend/ (for example backend/tests/fixtures/cache), so a backend-only change could break this spec without the PR running it.

🤖 Generated with Claude Code

Offline, a resolved demo-pack object whose SPHEREx frame list is not
cached answered 503 and the Flipbook's error state had no Build it.

- Show Build it under the error when the object resolved.
- Add unit tests for the error state.
- Re-enable demoPackOffline.spec.ts, kill its whole server process tree,
  and install uv in the frontend e2e job so CI can run it.

Closes #184

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ronisahajoo

Copy link
Copy Markdown
Collaborator Author

Tested manually: the Build it button now works on every object I tried.

The SwiftShader build on a CI runner outlasts the default 30 s test
timeout, so both attempts failed while the pane was still building.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ronisahajoo

Copy link
Copy Markdown
Collaborator Author

CI failure on the first run and the follow-up

  • Shard 2, demoPackOffline.spec.ts: failed on both tries by exceeding the default 30 s test timeout. At least one attempt was still building the 3D view, after Build it had been clicked. Fixed by raising this test's timeout to 150 s. It passes locally.
  • Shard 1, build.spec.ts:465: failed on both tries on an image comparison. It looks unrelated to this PR: it failed at least once in 7 of 10 earlier runs checked, and on both tries in 2 of them, including one on main. Not changed here.
  • Shard 1, colour.spec.ts:91: reported as flaky in the same run. Not changed here.

@JoottunAtish JoottunAtish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with nits. This covers all five "Done when" items in #184 with the frontend-only option A, so the contract is unchanged. status === 'error' && sky.resolved can only happen when frames gave up after a successful resolve, so a resolve failure and a coordinate search still get no button. The unit tests cover both cases. CI is green.

Nits (non-blocking, fine as a follow-up):

  1. Copy: under a 503 offline_cache_miss, the error still says "Try again in a moment", which never helps offline. A frames-specific line would read better, for example "The SPHEREx frames for this object couldn't be loaded. You can still build it in 3D."
  2. The ci.yml path filter: the offline spec now starts the backend and reads backend/tests/fixtures/cache. Add the backend paths to the frontend filter, as testing.md's rule asks.
  3. All 4 shards install uv, but only one runs this spec. Consider gating it.
  4. demoPackOffline.spec.ts killTree: on Windows taskkill can throw if the process has already exited, which skips the rmSync of the temp cache. Wrap it in try/catch, or move rmSync into a finally.
  5. UML 08 could note that Build it is also offered under the frames error.
  6. Can /frames return 404 for a resolved object? If so, "No object found" would sit next to Build it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ronisahajoo
ronisahajoo added this pull request to the merge queue Nov 30, 2026
Merged via the queue into dev with commit 4f40930 Nov 30, 2026
10 checks passed
@ronisahajoo
ronisahajoo deleted the fix/184-offline-build-it branch December 1, 2026 06:03
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.

Offline demo pack: no "Build it" when the frame list is not cached (503 offline_cache_miss)

2 participants