Skip to content

fix(xr): an analysis that hangs or fails can no longer freeze the switcher (S7) - #88

Merged
aMonteSl merged 2 commits into
v1.2.1from
claude/project-thread-kvvyg6-lifecycle
Nov 25, 2026
Merged

aMonteSl merged 2 commits into
v1.2.1from
claude/project-thread-kvvyg6-lifecycle

Conversation

@aMonteSl

Copy link
Copy Markdown
Collaborator

Requested by Adrián · project thread

Closes #79 (story S7 of epic #72). Also fixes LIFECYCLE-4 (from S10 #82) and DEPGRAPH-7 (from S13 #85), because both sit on the same code path.

What was wrong

The in-scene switcher queued every transition behind the one before it, with no time limit. One activate() that never settled froze the switcher for the rest of the session. For example, a dependency dataset fetch that stalled over a tunnel did this, and even "Normal analysis" stopped responding (LIFECYCLE-1, blocker).

Failures also had problems:

  • They were reported on a status line that is hidden while the selector is open.
  • The room's echo retried them.
  • They left the other participants in the failed mode.
  • A late analysis-mode-selection could send everyone back to the selector after they had picked an analysis.

Changes

  • Cancel instead of queueing. A newer pick aborts the activation in flight, using an AbortSignal on the activation and its token. Abandoned activations that settle later are deactivated again.
  • Timeouts. activate times out after 45 s by default, set per lifecycle with activateTimeoutMs (project evolution uses 90 s). The cleanup hooks time out after 8 s.
  • Failure state on the selector.
    • The selector shows the reason and a "Retry: …" option.
    • The failed mode does not become requestedMode.
    • The room is sent analysis-mode-selection when the pick was local.
    • The echo of the failed pick is ignored for 5 s.
    • getState() exposes activation, lastError and selectorStatus.
  • Ordered intents. openSelector only announces the selection if no newer pick happened since it opened.
  • Dependency graph.
    • The signal is passed to fetch.
    • A failed load rejects, so the mode fails visibly, and the panel error stays put.
    • Progress shows on the selector, and a second click gets an answer.
    • Progress messages re-arm the 20 s watchdog.
    • Picking the mode while an analysis is running attaches to that analysis.
    • Start retries are bounded.
  • Historical comparison. The signal is passed to fetch, a failed load rejects, and an abandoned activation exits early.
  • Project evolution. Re-entering the mode after a half-built frame re-seeks instead of throwing null.setAttribute.
  • Collaboration.
    • Errors from individual runtimes are isolated and logged, and analysis-view is applied last in a snapshot.
    • Reconnects back off exponentially from 0.9 s to a 15 s cap.
    • A room snapshot resets the revision floor.
    • The mode runtime no longer silently gives up while waiting for the client.
  • Containment. The end of a fit animation no longer re-shows a chart that was hidden in the meantime. This was found while verifying.
  • Harnesses. test:xr-mode-harness and test:xr-immersive-harness now serve over HTTP (test/helpers/staticHttpServer.cjs). Under file:// every dataset fetch was blocked, so data failures could never show up in them.

Verification

  • npm test: 1097/1097 passing, lint at 158 warnings (the budget).
  • New tests:
    • analysisModeLifecycleContract.test.cjs (8 tests): a hung activate is abandoned on a new pick; a timeout produces a visible error with Retry; the echo does not retry a failure; a failure caused by an echo does not move the room; no late selection; a hung hook is abandoned; selector progress; revision reset on snapshot.
    • 3 dependency-graph tests and 2 collaboration tests.
  • test:xr-mode-harness, test:xr-harness, test:project-evolution-harness and test:xr-immersive-harness all pass locally.
  • The audit's headless scenarios now pass:
    • activateHangs: Normal analysis opens.
    • activateThrows: a visible error, one deactivate, the room gets the selection.
    • selectorLateMessage: the pick is kept.
    • datasetFails: a visible HTTP 500.
    • rapidSwitch: converges.

Needs your eyes in a headset: read the error and the Retry label on the selector, and the dependency graph's "Opening dependencies…" progress.


Generated by Claude Code

…tcher

Story S7 (#79) of epic #72. The in-scene mode switcher queued every
transition behind the previous one with no limit, so one activate that
never settled froze it for the session (LIFECYCLE-1).

- changeAnalysis cancels instead of queueing: a newer pick aborts the
  activation in flight (AbortSignal on the activation and its token),
  activate has a timeout (45 s, project evolution 90 s), the cleanup
  hooks are abandoned after 8 s, and an abandoned activate that settles
  later is deactivated again.
- A failure lands on the selector with its reason and a "Retry" option,
  does not become requestedMode, tells the room when the pick was local,
  and the room's echo of the failed pick is ignored (LIFECYCLE-3).
- openSelector skips its selection announcement when a newer pick
  happened meanwhile (LIFECYCLE-2).
- Dependency graph and historical comparison pass the signal to fetch
  and reject on a load failure; the dependency load error is sticky
  (LIFECYCLE-5); the dependency start shows progress on the selector,
  re-arms its watchdog on progress, attaches to a running analysis and
  bounds its send retries (LIFECYCLE-6, DEPGRAPH-7).
- Project evolution re-entry after a half-built frame no longer throws
  (LIFECYCLE-4).
- Collaboration: per-runtime error isolation with logging, analysis-view
  applied last, reconnect back-off, revision floor reset by a room
  snapshot, no silent give-up registering (LIFECYCLE-9, LIFECYCLE-11).
- The end of a containment fit animation no longer re-shows a chart
  hidden meanwhile.
- The mode and immersive harnesses are served over HTTP so the modes'
  datasets load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FkKtAtQus8TVjhG9bhytC
@aMonteSl aMonteSl added tfm Adds the issue to the TFM board automatically. Do not remove area: xr-scene Browser runtimes of the XR scenes and LivePanel (A-Frame/BabiaXR, templates/components) area: testing Test suites, harnesses, verification and inventories stream: xr-bugfix-1.2.1 Epic #72: review and fix the XR environment, shipped in 1.2.1 labels Nov 25, 2026 — with Claude
@aMonteSl aMonteSl self-assigned this Nov 25, 2026
…nto claude/project-thread-kvvyg6-lifecycle
@aMonteSl
aMonteSl merged commit e762578 into v1.2.1 Nov 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: testing Test suites, harnesses, verification and inventories area: xr-scene Browser runtimes of the XR scenes and LivePanel (A-Frame/BabiaXR, templates/components) stream: xr-bugfix-1.2.1 Epic #72: review and fix the XR environment, shipped in 1.2.1 tfm Adds the issue to the TFM board automatically. Do not remove

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants