Skip to content

#1071 Switching threads replays the previous thread's start request as a phantom start - #19

Merged
Tevin2119 merged 2 commits into
masterfrom
delivery/1071-switching-threads-replays-the-previous-t-50dfded2de
Oct 7, 2026
Merged

Tevin2119 merged 2 commits into
masterfrom
delivery/1071-switching-threads-replays-the-previous-t-50dfded2de

Conversation

@polymaniadeveloper-hub

Copy link
Copy Markdown
Collaborator

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.

  • Finding: find-83b4394ddb, not blocking, out of scope of the task it was found on, not in the code that change delivered
  • Run: run-8bc6813438
  • Candidate tested: 7dc6bf8
  • Evidence: /Users/tevinmuparadzi/.paperclip/polymania/runs/run-8bc6813438/evidence

Done when

  1. Press Start on thread t1 while it is refused (teams still loading), then switch to thread t2: no task is saved or submitted for t2, and the page stays on the thread.
  2. Switching between two threads that both have orchestrator drafts, in either direction and several times, never saves, submits or navigates to /board by itself.
  3. Press Save draft on t1, then switch to t2: no save request is sent for t2.
  4. After switching to t2, pressing Start on t2 once saves and submits t2's task exactly once and navigates to /board.
  5. After switching to t2, pressing Save draft on t2 once saves t2's draft exactly once.
  6. After switching back to t1, an earlier Start press on t1 is not replayed: t1 starts only when Start is pressed again on t1.
  7. A focused test reproduces the QA scenario (t2 settled, switch to t1 with /api/teams pending, press Start, switch back to t2) and checks that no submit request is made for t2.

Opened by the delivery engine after a person's approval. Merging is a separate step.

…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.
@Tevin2119
Tevin2119 changed the base branch from fix/mobile-board-exit to master October 7, 2026 20:28
# Conflicts:
#	apps/web/src/components/delivery/OrchestratorComposerControls.test.tsx
@Tevin2119
Tevin2119 merged commit ff62477 into master Oct 7, 2026
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