Repository navigation
#1071 Switching threads replays the previous thread's start request as a phantom start - #19
Merged
Tevin2119 merged 2 commits intoOct 7, 2026
Conversation
…antom start
Fixed phantom Start/Save on thread switch in OrchestratorComposerControls: the handled-request refs now hold {threadId, request} snapshots, so a thread change (including returning to a thread) only records the new thread's counter as the baseline, and only a raised counter on the unchanged focused thread calls onStart/onSave. A re-render that only brings new callbacks runs nothing. Added 4 tests that switch threads without remounting: the exact QA scenario (no request of any kind for t2), repeated switches in both directions with unequal counters plus no replay of t1's refused Start, Save isolation, and a single Start on t2 saving and submitting once and navigating to /board once. I ran the suite against the original component in my working folder: all 4 new tests failed on phantom /api/tasks requests and the 10 existing tests passed.
Task task-ad62ac1929, revision 2, run run-50dfded2de.
# Conflicts: # apps/web/src/components/delivery/OrchestratorComposerControls.test.tsx
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.
Task pingdotgg#1071, run run-50dfded2de. Approved by T for commit 9dda80d, which passed its checks and the QA gate.
What was asked
Found by qa-attack (zhipu) while testing task task-7551d03f55.
Steps: In .qa/probe-attack.test.tsx run the test named 'PROBE (pre-existing): switching threads replays the old thread's start counter as a phantom start' (pnpm exec vp test run .qa/probe-attack.test.tsx). It focuses thread t2 with teams loaded so t2 settles, switches to t1 while /api/teams is pending and presses Start (refused for loading), then switches focus back to t2.
Expected: Switching threads alone starts nothing; a workflow starts only after a Start request on the focused thread.
Actual: The switch itself fires onStart for t2 (handledStart ref holds t1's counter while startRequests is per thread), and t2's workflow is saved and submitted with no press on t2; the draft is left and navigation to /board happens.
Done when
Opened by the delivery engine after a person's approval. Merging is a separate step.