Repository navigation
fix(models): stop activation polling after leaving the page - #4962
Merged
gabsprogrammer merged 1 commit intoSep 15, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/modelsfor 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
useModelsunder 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.actwarning 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
3b6b7a4628b636ef3b005a3eef92dffefeeb1948has 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
e8f982f09ba4c714ee2a65cb6867ea3e4328bfdecombines the 30 September 14 candidates. Its complete frontend suite passes 144 files / 1,125 tests, and its production build passes.