[ISS-12] Watch-handshake: achtergrond tijdens een probe verliest het antwoord (race in probeOnce), test faalt ~43% #388
Closed
opened 2026-10-18 19:20:05 +02:00 by janpeter
·
0 comments
No Branch/Tag specified
main
feat/idea-264-i3-budget-log
feat/idea-264-i3
claude/idea-264-i3-plan
feat/idea-269-agent-model-facts
docs/idea-264-i3-spec-richting-b
fix/iss-13-taken-detail
docs/idea-264-i2-statuslabel
docs/idea-264-i2-afsluiting
docs-audit/cmvg8v3n400oozr7r0kb50idv
fix/iss-14-watch-429-embargo
feat/idea-264-i2
feat/idea-267-toegang
feat/toggle-switch
claude/idea-264-i2-plan
docs/idea-264-i1-afsluiting
docs/idea-264-i1-build-30
claude/allowlist-concept-scrum4me-d3e876
feat/idea-264-i1
fix/iss-12-probe-result-tests
feat/story-j4vtjt77
feat/story-tie78lwk
fix/iss-12-handshake-probe-race
claude/idea-264-i1-plan
claude/vigilant-carson-2nl3zw
feat/idea-261-scrum-pushfilter
feat/idea-261-i1-push
feat/idea-261-i1
docs/m53-status
docs/idea-262-agent-chat-tools
claude/gsq-lokaal-mcp-tools-d64fbb
feat/idea-261-review
fix/iss-17-backfill-idea-links
docs-audit/cmv7o7w5a00oxm97rggkn057n
feat/idea-249-usage-issue-scope
docs-audit/cmv68rycc00hdin7r641rn8jk
claude/idea-251-dispatch-idea-links
feat/sprint-qrj25rbn
claude/st074-seeds-no-usd-proxy
feat/sprint-y62ub8wt
docs/m50-1b-open-punten
fix/m50-1b-follow-ups
docs/m50-1b-toolbudget
docs/m52-besluiten
docs/m50-1b-status
chore/ci-measure-runs
feat/m50-1b-agent-chat
docs/ci-audit-m51-m52
feat/ci-quick-wins
claude/forgejo-actions-audit-6a1cea
claude/chat-agent-voorstel
feat/m50-1a-agent-chat
fix/vis-tooltip-hover-card
feat/pbi36-insights-usd
fix/m49-worker-count-race
feat/pbi36-api-list-prices
fix/m49-issue-sweep
docs/claude-md-trim
feat/idea-245-closed-schema-chain
archive/scrum4me-loose-2026-10-09
docs/m45-3-status
docs/m45-3-plan
docs/m45-2e-status
feat/m45-2e-cutover-script
docs/m45-2e-plan
docs/m45-2d-status
codex/m48-increment-2-plan
docs-audit/cmuz3ktch019no07rasrel10e
feat/m48-codex-rate-cards
docs/m47-workers-productcode
codex/m48-plan-review-loop
chore/remove-vercel
claude/controleer-proef-1-86ee24
claude/codex-usage-ledger-cd99f1
docs/m45-2d-plan
docs/harness-runtime-spec
docs-audit/cmuxo4x2b013f687r3wvi0f2s
feat/m45-2c-harness-web
archive/qr-login-sessieduur
feat/m45-2a-harness-db
docs/iss12-signed-off-unstarted
claude/usage-input-incl-cache-write
docs/iss-11-runbook-product-toevoegen
docs/m44-vis-ops-media-plan
fix/m42-review-minors
feat/m42-vis-ios
feat/m42-vis-web
claude/design-systems-knowledge-ai-8eb6f4
claude/t1972-dispatch-usage-docs
fix/proxy-segment-match
claude/claude-md-proxy-routes
claude/m41-g8c-docs
claude/m41-increment-5b
claude/m41-increment-5
claude/m41-increment-4
claude/m41-increment-3
claude/m41-increment-2
claude/review-loop-jobs-scrum4me-302e66
codex/tanstack-v9-table-spec
claude/sleepy-dirac-162dc6
docs/agent-guide-startflow-t156
docs-audit/cmum8m5dr00mjum7rdow39jvj
feat/notes-pbi-167
docs-audit/cmukt691o003sk47rb59n2j6m
codex/idea-227-token-usage
docs-audit/cmuhyah3l003pmt7rgqgmgizx
feat/m2-idea-chat-local-routing
chore/remove-neon-backup-workflow
fix/sse-connection-close
fix/graceful-shutdown-sse-reconnect
fix/graceful-shutdown-sse
docs-audit/cmugiunf9006rob7rduq61mxq
fix/story-rollup-excluded
feat/contract-worker-role
fix/idea-213-manifest-productie-kolomvolgorde
fix/hub-watch-file-parallelism
docs/standardize-claude-workflow
feat/get-context-sprint-2026-09-23
feat/idea-213-dispatch
claude/backlog-task-character-limit-c6ac11
feat/idea-213-implementation-plan
feat/idea-213-design-review
archive/watch-repair-842897c7
claude/watch-handshake-recovery
claude/idea-212-watch-presets
claude/t1775-baseline
codex/t1775-warning-fixes
codex/t1775-open-points
codex/t1775-explicit-grants-review
codex/hub-watch-r2
codex/hub-watch-r1
feat/m39-web-b7-docs
feat/m39-web-drift-checker
feat/m39-web-add-model-cli
feat/m39-web-agent-models
feat/m39-web-models
chore/build-19
feat/m40-watch-no-stale-notice
feat/m40-watch-overzicht
feat/m40-gate-f5
feat/m40-gate-fixes
feat/m40-iwatch-messages
feat/ios-message-acknowledge
feat/ios-badge-seen-reset
claude/sprint-job-work-loss-aa2c6e
codex/ios-inbox-active-job-dedupe
codex/ios-build-17
codex/ios-ui-ux-remediation-plan
fix/sectiekoppen
feat/pairing-plakveld
fix/witte-tekst
fix/approval-opties-onder-elkaar
fix/watch-leesbaarheid
claude/m37-wave3-watch
chore/ios-build-11
codex/opus-48-job-defaults
codex/ios-rules-compact-detail
claude/proddocs-latest-version-6db78d
codex/ios-queue-compact-status-time
codex/ios-queue-status-elapsed
codex/ios-toolbar-reorder
codex/idea-193-ios-hub-polish
claude/distracted-tesla-cbfc5a
claude/eloquent-mclean-9b5038
claude/approval-mechanism-m33-m34-300c69
codex/idea-169-forgejo-ci-host-scrum4me
feat/shadcn-scrum4me-skill
feat/shadcn-scrum4me-source-proof
codex/idea-169-runtime-rebaseline-scrum4me
fix/hub-sse-empty-lines
feat/idea-186-plan-b-realtime
claude/ios-app-aanpassingen-d0d3cd
fix/test-synthetic-token-prefix
claude/hub-auto-mode-spec
feat/st-043-human-readable-references-pr
feat/st-043-human-readable-references
fix/hub-redact-sk-keys
fix/hub-redact-secrets
docs/m33-gate-item3
chore/ios-build-5
feat/inbox-filter-keuzelijsten
fix/shared-js-extension-webpack
claude/issue-tracker-per-product-4720ca
fix/hub-question-listener-generation
fix/realtime-listen-multiplex
fix/prisma-singleton-pool
chore/hub-signature-drop-v1
chore/ios-build-number
feat/hub-signature-canonicalisatie
docs/hook-wait-window
fix/hub-ask-output-shape
docs/hook-permission-modes
chore/ios-export-compliance
docs/testflight-gate-notes
chore/ios-signing
fix/hub-decision-signature
chore/ios-test-tooling
claude/approve-options-expand-b646cc
fix/pr-detector-fetch-timeout
archive/sharp-volhard-hub-ios-jsonvalue
feat/m33-hub-inbox
feat/m32-archivering
claude/hub-inbox-queue-handoff-695e63
fix/hub-hook-runbook
fix/hub-answered-push-noise
docs/hub-hook-env-export-fix
fix/hub-notif-mainthread
feat/hub-app-shell
claude/idea-179-pak-op-8dadd6
fix/push-subscription-change
feat/push-app-scope
feat/m30-p0.3-idempotency-ddl
claude/productdoc-char-limit-891e6d
fix/realtime-job-status-event-name
feat/shared-kimi-bump
fix/review-verdict-comment
feat/queue-identity-shared
feat/sprint-fccnln4y
fix/sprint-enqueue-notify
feat/s4m-queue-tables
chore/gen-schema-drop-url-strip
codex/codex-model-catalog
fix/idea-chat-realtime-ux
codex/worker-usage-web-schema
fix/build-confirm-dialog-test-mock
fix/docs-verdict-keten-anchor
docs/m23-runbook-spec-kinds
fix/m23-vendor-pointer-sha
chore/m23-vendor-bump-shared
claude/s4m-queue-scrum4me-brainstorm-2ba392
claude/idea-139-verify-gate-failure-619450
docs/M20-review-plan-runbook
feat/M20-plan-review-loop
fix/docs-audit-exclude-demo-nonforge
feat/M19-docs-audit-job
docs/m19-spec-auto-merge-fix
docs/auto-merge-deploy-runbooks
feat/auto-merge-reliability
feat/sprint-batch-auto-deploy
feat/story-bp36s0io
feat/story-t3v1nvw3
feat/story-s4my5gkx
feat/story-0mahmmv7
feat/story-crgu79ya
feat/story-hk6wgyze
feat/story-rqo3qanp
codex/notifications-sheet-scroll
feat/story-w2mhpq7a
feat/sprint-i70wwm4g
feat/story-b6lqzo0w
codex/product-auto-review-merge-settings
codex/split-pane-select-none
claude/keen-khayyam-3edfee
chore/idea-chat-shared-shim
feat/seed-job-kind-config
fix/m17-deploy-fields-idempotent
claude/gallant-kepler-c118ed
feat/idea-chat-follow-up
feat/idea-grill-brainstorm-skill
fix/idea-chat-question-refresh
claude/goofy-newton-4aa0bf
feat/idea-chat-channel
claude/quizzical-benz-5545ea
claude/job-kind-config-phase5-web
claude/job-kind-config-phase2
claude/web-reviewlog-migration
fix/qr-login-proxy-host
claude/product-settings-tabs
claude/avg-gate-d-seed
feat/copilot-content-policy-web
codex/mobile-entry-detection-selectors
feat/copilot-content-policy-migration
claude/copilot-userroles-webui
claude/copilot-user-roles
feat/copilot-jobsource-constraint
feat/copilot-foundation-migration
claude/frosty-edison-90ea6c
feat/codex-auto-dispatch-phase4
fix/claude-jobs-constraint-manual-task-review
feat/pr-review-kind-migration
docs/audit-2026-06-06
feat/sprint-di155g5p
codex/mobile-focus-qr-ideas-solo-jobs
claude/suspicious-dirac-2e2511
feat/worker-capability-migration
landing/workers-domain-env
codex/landing-platform-positioning
feat/sprint-draft-eligibility
chore/sync-generated-schema
claude/fervent-agnesi-ac3bfd
feat/sprint-ro4jcvyb
fix/bump-shared-idea-notification
fix/idea-notifications-kind-enum-replay
feat/prepare-worktree-script
feat/sprint-x5bootxw
feat/sprint-1uvgt1ae
feat/sprint-rxggrwjn
codex/clarify-manual-editor-plan-after-phase0-defer
docs/m16-v2-manual-job-editor-plan
feat/sprint-nmlr4ddq
codex/v2-manual-job-draft-db-contract-current
codex/anthropic-key-model-sync-policy
codex/tighten-claude-job-kind-constraint
fix/resolve-stale-prisma-migrations
fix/claude-jobs-constraint-sprint-aware
feat/M16-fase3-shared-bump
docs/M16-fase3-plan
janpeter-patch-1
feat/M16-fase2-scrum4me-readonly
docs/M16-fase2-plan
feat/M16-fase1-promote-admin
docs/M16-fase1-plan
feat/M16-platform-split-shared-bootstrap
feat/platform-split-design
claude/optimistic-bardeen-c9915d
feat/sprint-cqsmq2bs
feat/product-docs-index-rag-design
feat/sprint-praz0n8t
feat/sprint-j2qn0s3c
feat/sprint-rbrnzlvm
docs/forgejo-pr-automation
feat/pbi-104-skeleton-update
claude/sweet-torvalds-307aae
feat/sprint-72cw2w80
fix/doc-links-skip-plans
fix/idea-timeline-test-prisma-import
feat/pbi-102-pbi-doc-linking
feat/migrate-user-script
docs/sprint-in-plan-flow
docs/task-templates-and-mcp-pointer
claude/bold-kowalevski-84ed82
claude/tender-clarke-25da3b
docs/forgejo-pr-rule
claude/friendly-williamson-02ff6b
feat/sprint-tzw3dt4h
feat/story-pxzrkdbk
claude/cranky-mahavira-593107
claude/nice-ellis-73cb84
feat/story-05mofrm7
feat/story-v3leym34
feat/story-qfpqpxzy
feat/story-dgognlsz
feat/story-d9sl8egw
feat/story-mgsu85hr
feat/auto-pr-ui-and-docs
feat/pbi-36-sync-tab
feat/pbi-36-deploy-controle
feat/pbi-37-skipped-job-status
feat/story-0vtnydpi
feat/story-7pl4dsb6
feat/story-hyikiufi
feat/story-abeu63oz
feat/story-xmwvqru1
feat/story-111ci8t4
feat/story-l9kkxh2m
feat/story-nma6ylbl
fix/idea-pbi-link-route
fix/idea-timeline-auto-refresh
fix/idea-timeline-hydration-locale
fix/m12-bell-loses-idea-questions-on-reconnect
fix/m12-idea-question-answering
feat/m12-ideas
docs/pr-merge-conflict-faq
chore/before-launch-changelog
feat/a11y-tap-targets-aria
feat/a11y-audit-fixes
feat/rate-limit-mutations
feat/sentry-error-monitoring
feat/story-q5wkvcsw
feat/product-edit-icon-on-dashboard
docs/v1-readiness
feat/ST-1134-mobile-shell-foundation
docs/pbi-11-plan-update
feat/sprint-backlog-filter-popover
chore/untrack-claude-settings
fix/task-detail-dialog-scroll
feat/entity-codes-required
feat/dialogs-pattern-compliance
fix/dashboard-product-dialog-click-bubble
fix/navbar-product-switch-onclick
restore/landing-and-edit
feat/dashboard-edit-and-switch-fix
feat/landing-local-first
feat/story-5zxw315t
feat/story-jhv1gvva
feat/story-0ljj3v5f
feat/story-1ljfxsml
feat/story-bq1xaz8n
pr-61
feat/story-txfrl2fx
feat/story-iaiejaai
feat/story-g700butf
feat/docs-adr-and-index
feat/story-d22cg3jb
feat/story-user88b9
feat/story-r73bta1r
feat/story-1r1t20mo
fix/vercel-deploy-blockers
feat/agent-cross-repo-support
feat/story-0d5e4arl
feat/story-slcb4r45
feat/story-yr77flb1
fix/insights-complete-page
feat/story-ot7dymrf
feat/story-2ap9tf9y
feat/story-c9enpvfa
feat/story-hlautjjp
feat/story-x35n155c
docs/dialog-pattern
fix/sse-pg-cleanup-leak
feat/story-liq2tae9
feat/job-mgskzyvx
feat/plan-snapshot-claude-job
feat/split-pane-n-pane
feat/M14-task-dialog
chore/debug-realtime-tooling
feat/M12-demo-readonly
feat/M12-pbi-status
chore/m12-docs-sync
docs/cleanup-claude-md
feat/M11-claude-questions
feat/M10-qr-login
feat/ST-1001-qr-login-milestone-plan
feat/M9-active-product-backlog
feat/ST-801-realtime-triggers
tooling/insert-milestone-script
feat/m8-realtime-solo-backlog
docs/workflow-update-2026-04-27
v1.0.0
v0.9.0
Labels
No labels
severity/s3
severity/s4
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
janpeter/Scrum4Me#388
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status: closed (fixed) · Severity: s3_major · Gemeld door: mac:claude · Occurrences: 1 (laatst: 2026-10-18T17:11:54.852Z) · Aangemaakt: 2026-10-18T17:11:54.852Z
Registratie
Symptoom
npm run ios:testis onbetrouwbaar rood opHubTransportTests.WatchHandshakeControllerTests.testBackgroundDuringAProbeKeepsProofButStartsNoBootstrap(ios/Hub/Tests/HubTransportTests/WatchHandshakeControllerTests.swift:190-200):Gemeten op 2026-10-18 (branch
feat/idea-264-i1, commit27a36f3a; de test enWatchHandshakeControllerzijn daar ongewijzigd t.o.v. main):npm run ios:test -- -only-testing:HubTransportTests/WatchHandshakeControllerTests/testBackgroundDuringAProbeKeepsProofButStartsNoBootstrap -test-iterations 40: 17 van 40 iteraties falen;ios:test: 3 van de laatste 4 runs rood op deze test (of een andere bekende flake).Oorzaak (codelezing)
ios/Hub/Sources/HubTransport/WatchHandshakeController.swift:onProbetijdens de probeenterBackground()aanroepen →cancelEpisode()(:220) annuleertepisodeTask;probeOnce(:208-217) racet in een task group hetsend-kind tegen eensleep(probeTimeout)-kind. Door de annulering gooitTask.sleepin het timeout-kind direct, dat kind geeft meteennil;send-kind dat het antwoord teruggeeft, dan isreply == nil, wordt er in de takepisodeCounter != id(:176-185) geen bewijs bewaard en blijft de statuswaiting.Dit is ook productiegedrag, niet alleen een testprobleem: de standaard-
sleepis ooktry? await Task.sleep. Een Watch die midden in een probe naar de achtergrond gaat, kan het (geldige) antwoord dus kwijtraken. Herstelbaar (de volgende foreground probet opnieuw), maar het doel van de test ("positief bewijs blijft bewaard") wordt niet gegarandeerd.Gevolg
npm run ios:test) zijn ~43% van de runs rood zonder dat de gewijzigde code iets fout doet; dat ondermijnt het bewijs van elke iOS-taak (IDEA-264 I1-sprint).Mogelijke richting (niet uitgevoerd)
Bij annulering het
send-kind laten afwachten in plaats van de timeout direct te laten winnen (bv. bijTask.isCancellednagroup.next()het andere kind nog afwachten, of het timeout-kind bij annulering niet laten terugkeren), en de test deterministisch maken. Herkomst: commits0a510b79/2f986780(ST-1580, Watch B2).Gevonden tijdens de uitvoering van IDEA-264 I1 taak 4; daar bewust niet gerepareerd (buiten scope).
Onderzoek
2026-10-18T20:02:46.030Z — mac:claude
Onderzoek (mac:claude, branch fix/iss-12-handshake-probe-race vanaf origin/main
f293666c)Oorzaak bevestigd door codelezing van
WatchHandshakeController.probeOnce(:208-217):enterBackground()→cancelEpisode()annuleertepisodeTask; die annulering propageert naar beide kinderen van de task group.Task.sleep(productie:try? await Task.sleep; test-fake idem) keert in een geannuleerde task onmiddellijk terug, dus het timeout-kind geeft directnil. Hetsend-kind moet eerst van de MainActor terug (de testhaakonProberoeptenterBackgroundaan) en verliest de race ~43% van de keren.first == nil→ in de takepisodeCounter != idis er geen reply om als bewijs te bewaren → status blijftwaiting.Latentie:
withTaskGroupwacht sowieso op alle kinderen vóór hij terugkeert, en hetsend-kind berekent zijn antwoord dus al; het wordt nu alleen weggegooid. Het afwachten ervan na annulering kost niets extra (productie-probeProtocolheeft bovendien een eigen, niet-annuleerbare 5s-vangnet inWatchRelay).Plan (klein): alleen
probeOnceaanpassen — het timeout-kind meldtwindowElapsedofwindowCancelled(viaTask.isCancelledna de slaap); bijwindowCancelledblijft de groep op hetsend-antwoord wachten. Test deterministisch maken met een gate die het antwoord pas vrijgeeft nadat de geannuleerde slaap is teruggekeerd (forceert de verliezende volgorde, 100% rood op de oude code).WatchFeatureProbeController(IDEA-264,feat/idea-264-i1) heeft hetzelfdeprobeOnce-patroon en heeft dezelfde wijziging nodig; bewust hier niet aangeraakt."Oplossing
2026-10-18T20:08:30.958Z — mac:claude
Fix klaar op branch
fix/iss-12-handshake-probe-race(commit1b3a0191, vanaf origin/mainf293666c), nog niet gepusht; sluiten volgt na de merge door JP.Wijziging:
WatchHandshakeController.probeOnceonderscheidt nu een verstreken 5s-venster van een door annulering afgebroken slaap (Task.isCancelledna de slaap in het timeout-kind) en wacht in het laatste geval op hetsend-antwoord. Daardoor bewaart de takepisodeCounter != idhet bewijs ook als de episode tijdens de probe is geannuleerd. Geen extra latentie (de task group wacht sowieso op beide kinderen).Test:
testBackgroundDuringAProbeKeepsProofButStartsNoBootstrapdwingt nu de verliezende volgorde af (gate.replyAfterWindowEnded) en doorloopt daarnaast de natuurlijke volgorde.Bewijs: oude controller, 10 iteraties: afgedwongen volgorde 10/10 rood (natuurlijke 3/10). Nieuwe controller: 40/40 groen in de geïsoleerde run;
npm run ios:test4× achter elkaar groen (265 tests);npm run ios:buildBUILD SUCCEEDED.Follow-up:
WatchFeatureProbeController.probeOnce(IDEA-264,feat/idea-264-i1) heeft hetzelfde patroon en heeft dezelfde wijziging nodig; hier bewust niet aangeraakt. Klein, bestaand aandachtspunt: een late reply van de vorige companion nacompanionChanged()wordt in dezelfde tak als bewijs bewaard (buiten scope).2026-10-18T20:10:19.724Z — mac:claude
Aanvullend bewijs:
WatchHandshakeControllerTests+WatchHandshakeChainTests(30 testcases, alle annuleerpaden) 40 iteraties achter elkaar op de fix: 0 errors, TEST SUCCEEDED.2026-10-18T20:41:54.524Z — mac:claude
Gemerged: PR #391 (merge
cc74ff7e, CI groen). Review (s4m-codex-reviewer, LOW): de gate-variant van de test garandeert de verliezende volgorde niet strikt. Opgevolgd in een kleine testversterking (commit04b1d786op fix/iss-12-probe-result-tests, de beslislogica alsprobeResult(next:)zodat een test de uitkomstvolgorde vastlegt; geen gedragswijziging): oude logica 40/40 rood, huidige logica 160/160 groen,ios:test2× groen (265),ios:buildgeslaagd. Die follow-up wacht op push/PR-akkoord van JP.