Files
orca/mobile/tests-typecheck-baseline.txt
Jinwoo Hong db2ffe7afe fix(mobile): default injected timers to receiver-free wrappers (#21416)
* fix(mobile): default injected timers to receiver-free wrappers

Every transport class stored a global timer function on an object and then
called it back through that object, so the receiver was the instance or the
dependency bag rather than the global. Hermes ignores the receiver; browsers
reject it with TypeError: Illegal invocation, which makes the web build fatal
at the first retry, liveness probe, or relay grace timer.

Default each injected timer to a wrapper that calls the global receiver-free,
and narrow the seam's type from `typeof setTimeout` to the call signature it
actually uses. Node's `typeof setTimeout` also demands a `__promisify__`
member that no injected timer or wrapper can supply, so the wrapper cannot
satisfy it. Pruning mobile-relay-background-grace.test.ts from the typecheck
baseline follows: the narrower type makes that file check clean.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* test(mobile): pin the default timers against a browser receiver check

Both classes are now constructed with no injected timers under a global
setTimeout/clearTimeout that throws Illegal invocation for any explicit
non-global receiver, mirroring the WebIDL rule. The watchdog gets its own
file because its existing test is grandfathered out of the typecheck ratchet.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* test(mobile): prove the default clear leg and drop bare timer injections

The clear assertions were vacuous: cancel() and stop() also drop the state a
fired callback checks, so a no-op default clearTimer stayed green. Both tests
now assert the wrapped global clearTimeout received the exact handle setTimeout
returned, which fails when that default is mutated to a no-op.

Three relay tests injected bare setTimeout/clearTimeout into dependency bags,
the same receiver shape the product fix removed; inert under node, fatal under
jsdom. relay-host-signed-out-verdict drops two `as unknown as typeof setTimeout`
casts, since ScheduleTimer now types those arrows contextually.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* test(mobile): census bare global timers parked in properties and defaults

mobile-endpoint-lifecycle could regress to bare globals with every other test
green, because nothing there is reachable from a unit test. Walk every product
file's AST and fail on a global timer parked where a later call reaches it
through a receiver: a `??` or `||` default, an object literal member, or an
assignment onto a property. A plain local capture stays legal, since calling it
bare leaves the receiver undefined.

A separate test asserts the walk sees the five fixed sites' wrapper shape, so an
empty or misdirected scan fails instead of passing vacuously.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* refactor(mobile): define the receiver-free timer defaults once

Five hand-written wrappers each restated the same invariant, so five places
could drift. timer-scheduler now exports defaultScheduleTimer and
defaultCancelTimer, and carries the reason for them; every site takes its
default from there. The census keys its presence precondition on those two
identifiers instead of the arrow shape.

The census also missed `??=` and `||=`, which park a global exactly like their
non-assigning forms. Both are handled now, with a parsed-source case per parking
form and one for the local capture that stays legal.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
2026-09-18 04:59:56 -04:00

131 lines
6.4 KiB
Plaintext

# Test files that do NOT yet typecheck under mobile/tsconfig.test.json.
# This is a RATCHET: the list may only SHRINK. Do NOT add entries to get CI green —
# an unchecked test is one whose type-level pins prove nothing.
# Regenerate/prune: node scripts/check-tests-typecheck-ratchet.mjs --prune
src/accounts-route-reset-credit.test.ts
src/browser/browser-command-reply-schema.test.ts
src/browser/mobile-browser-frameless-stream.test.tsx
src/components/CodexResetCreditAction.test.ts
src/components/HostProtocolGate.test.ts
src/components/MobileHomeQuickActions.test.ts
src/components/MobileHostCard-truthful-status.test.tsx
src/components/MobileHostCard.test.ts
src/components/MobileMarkdown.file-links.test.ts
src/components/MobileRichMarkdownEditor.test.tsx
src/components/NewWorktreeModal.test.tsx
src/components/PickerModal.accessibility.test.ts
src/components/WorktreeAgentList.test.tsx
src/components/agent-monitoring-indicators.test.ts
src/components/bottom-drawer-close-lifecycle.test.ts
src/components/bottom-drawer-window-handback.test.ts
src/components/codex-reset-credit-capability.test.ts
src/components/mobile-agent-icon-gradient.test.ts
src/components/pr-sidebar/PRCommentsSection.test.ts
src/diagnostics/connection-diagnostics-submission.test.ts
src/dictation/mobile-dictation-setup.test.ts
src/files/MobileFileExplorerPanel.test.ts
src/files/MobileFileMarkdownPreview.test.ts
src/hooks/mobile-dictation-desktop-start.test.ts
src/host-edit-route-accessibility.test.ts
src/host-edit-save-flow.test.ts
src/mock-server-key-pair.test.ts
src/notifications/notification-consent-ownership.test.ts
src/notifications/push-dismissal-native-races.test.ts
src/notifications/push-receive.test.ts
src/notifications/push-registration.test.ts
src/notifications/push-token.test.ts
src/onboarding/MobileOnboardingPage.test.ts
src/onboarding/NotificationOnboardingPreview.test.ts
src/onboarding/legacy-notification-opt-in-route.test.ts
src/onboarding/mobile-onboarding-screen.test.ts
src/session/MobileMarkdownReader.test.tsx
src/session/MobileNativeChatComposer.test.ts
src/session/MobileNativeChatMessage.test.ts
src/session/MobileNativeChatOverlay.test.ts
src/session/MobileNativeChatPermission.test.ts
src/session/MobileNativeChatQuestion.test.tsx
src/session/MobileNativeChatSessionOptionPickers.test.ts
src/session/MobileNativeChatSessionOptionRows.test.ts
src/session/MobileNativeChatTurnStatus.test.ts
src/session/MobileNativeChatView.test.ts
src/session/QuickCommandsList.test.ts
src/session/QuickCommandsSheet.test.ts
src/session/ai-vault-resume-launch.test.ts
src/session/mobile-file-tap-open.test.ts
src/session/mobile-native-chat-open-file.test.ts
src/session/mobile-session-route-parity.test.ts
src/session/mobile-session-tab-activation.test.ts
src/session/mobile-worker-takeover-send-sites.test.ts
src/session/pending-terminal-handle-recovery-poll.test.ts
src/session/session-reply-schema.test.ts
src/session/use-mobile-diff-review-send-actions.test.ts
src/session/use-mobile-file-tap-handlers.test.ts
src/session/use-mobile-native-chat-image-attachments.test.ts
src/session/use-mobile-native-chat-turn-disclosure.test.tsx
src/session/use-mobile-pr-branch-context.test.ts
src/session/use-mobile-pr-sidebar-controller.test.ts
src/session/use-mobile-session-terminal-create-actions.test.ts
src/session/use-mobile-structured-agent-session-send.test.tsx
src/session/use-mobile-structured-agent-session.test.tsx
src/session/use-mobile-structured-prompt-responses.test.tsx
src/session/use-mobile-terminal-inventory-recovery.test.ts
src/settings/native-notification-delivery-settings.test.tsx
src/settings/notification-display-test.test.tsx
src/settings/settings-screen-state.test.tsx
src/settings/voice-settings-poller-refresh.test.tsx
src/source-control/MobileGitHistoryList.test.tsx
src/source-control/mobile-branch-compare.test.ts
src/source-control/mobile-create-pr-action.test.ts
src/source-control/mobile-git-status.test.ts
src/source-control/mobile-hosted-review-create-intent-runner.test.ts
src/source-control/use-mobile-hosted-review-eligibility.test.ts
src/tasks/source-workspace-create.test.ts
src/tasks/task-source-search-reply-schema.test.ts
src/terminal/buffered-terminal-draft-restoration.test.ts
src/terminal/mobile-terminal-query-reply.test.ts
src/terminal/terminal-caret-rendering-oracle.test.ts
src/terminal/terminal-live-accessory-raw-send.test.ts
src/terminal/terminal-live-text-commit.test.ts
src/terminal/terminal-webview-engine-error.test.ts
src/terminal/terminal-webview-query-reply-routing.test.ts
src/terminal/terminal-webview-wheel-scroll.test.ts
src/terminal/use-buffered-terminal-drafts.test.tsx
src/terminal/worker-terminal-takeover-report.test.ts
src/test-support/rpc-recording/native-mounting-substitutes.test.ts
src/test-support/rpc-recording/operation-module-loader.test.ts
src/test-support/rpc-recording/screen-native-substitutes.test.ts
src/transport/client-context.test.ts
src/transport/connection-revival-triggers.test.ts
src/transport/host-credential-cleanup.test.ts
src/transport/host-edit-navigation.test.ts
src/transport/host-list-load-sharing.test.ts
src/transport/host-removal-lifecycle.test.ts
src/transport/host-status-gates.test.ts
src/transport/host-store.test.ts
src/transport/mobile-endpoint-supervisor-nudge.test.ts
src/transport/mobile-relay-background-lifecycle.test.ts
src/transport/mobile-relay-direct-upgrade.test.ts
src/transport/mobile-relay-e2ee-link.test.ts
src/transport/mobile-relay-pairing-recovery.test.ts
src/transport/mobile-relay-pairing-reply.test.ts
src/transport/mobile-relay-physical-client.test.ts
src/transport/mobile-relay-reconnect-controller.test.ts
src/transport/mobile-relay-resume-director.test.ts
src/transport/mobile-relay-rpc-session-liveness.test.ts
src/transport/mobile-relay-rpc-session.test.ts
src/transport/mobile-relay-runtime-failover.test.ts
src/transport/pairing-relay-candidate.test.ts
src/transport/pre-profile-pairing-coordinator.test.ts
src/transport/relay-host-signed-out-verdict.test.ts
src/transport/rpc-client-synthesized-close-diagnostics.test.ts
src/transport/rpc-operation.test.ts
src/transport/rpc-session-liveness-watchdog.test.ts
src/transport/runtime-capability-probe.test.ts
src/transport/settings-host-client-lifecycle.test.ts
src/worktree/agent-row-display.test.ts
src/worktree/agent-row-lineage.test.ts
src/worktree/host-worktree-refresh.test.ts
src/worktree/worktree-host-row-identity.test.ts
src/worktree/worktree-list-completeness.test.ts
src/worktree/worktree-list-snapshot.test.ts