Skip to content

fix(models): stop activation polling after leaving the page - #4962

Merged
gabsprogrammer merged 1 commit into
Osmantic:public-betafrom
0xacee:fix/models-stop-activation-polling-after-navigation
Sep 15, 2026
Merged

gabsprogrammer merged 1 commit into
Osmantic:public-betafrom
0xacee:fix/models-stop-activation-polling-after-navigation

Conversation

@0xacee

@0xacee 0xacee commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Why this matters

Start a model from Models, then navigate away while it is activating. The page's activation loop survives unmount and continues requesting /api/models for its full ten-minute budget. A mounted production page/hook regression records 123 additional reads after navigation on the base branch. Returning to Models adds another observer.

Tie activation observation to the page's lifetime. Unmount aborts its activation connection, wakes its cancellable poll delay, and cancels the activation-owned status read. Check cancellation before publishing a late response or issuing the final status request. The host continues to own any accepted activation; returning to Models reads that lifecycle and keeps actions locked without replaying the POST.

Validation

  • Four new mounted-page regressions fail on the base and pass after the change: navigation between polls, late status headers, late status body, and returning during a backend-owned activation. They exercise the production Models page and useModels under StrictMode, with only HTTP receipts and the unrelated download hook substituted.
  • npm test -- src/pages/Models.navigation.test.jsx src/pages/Models.test.jsx src/hooks/__tests__/useModels.test.js: 83 passed, including existing activation success, conflict, context, downstream readiness and ten-minute deadline behavior.
  • Combined validation with fix(models): validate dashboard model snapshots #3027's snapshot validation and fix(dashboard): explain model inventory timeouts #3376's timeout diagnostics, including their regression tests: 85 passed. Restored the standalone branch afterward.
  • Production build passes. Focused ESLint: zero errors, three JSX unused-import warnings. Existing React Router and one existing test act warning remain visible.

Overlap check

Searched live open/closed PR titles and production file changes for useModels.js, activation, navigation and unmount. #1967/#1980 establish host-authoritative activation tracking; #4557 strengthens its final status proof. #3027 validates inventory payloads and #3376 explains read timeouts; neither stops activation observation when its page disappears. #4813 and #3177 concern other components.

There is no functional dependency. Preferred merge order is this PR, #3027, then #3376. Their shared response/catch hunks need reconciliation: preserve cancellation checks before payload publication/error presentation and retain the current final-status proof. The combined 85-test run validates those behaviors together.

No backend cancellation endpoint, stored configuration, or host lifecycle changes. Reverting restores the previous browser polling behavior. Independent review is pending; no live GPU model activation was performed, so this does not certify host restart/rollback or hardware readiness.

Current validation

At the 2026-09-14 audit, head 3b6b7a4628b636ef3b005a3eef92dffefeeb1948 has 32 successful and 4 skipped hosted checks, with no failed or pending checks. Independent human review and the declared deployed/platform checks remain merge gates.

Local synthetic integration head e8f982f09ba4c714ee2a65cb6867ea3e4328bfde combines the 30 September 14 candidates. Its complete frontend suite passes 144 files / 1,125 tests, and its production build passes.

@gabsprogrammer
gabsprogrammer merged commit 117756c into Osmantic:public-beta Sep 15, 2026
36 checks passed
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