Skip to content

fix: pr-bug-scan validated finding from #1700 - #1728

Merged
Jinwoo-H merged 1 commit into
mainfrom
bot/pr-bug-scan-1700-1778641512
May 13, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
bot/pr-bug-scan-1700-1778641512

Conversation

@buf0-bot

@buf0-bot buf0-bot Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Automated fix-PR from pr-bug-scan for parent #1700.

Fixer status: FIXED_WITH_CODE_PROOF
Summary: Clear initializedHandlesRef on reconnect so the auto-resubscribed scrollback frame re-inits xterm instead of being dropped by the has(handle) guard.
Blocked proof link: mobile/app/h/[hostId]/session/[worktreeId].tsx ~638-642 (subscribe handler): if (data.type === 'scrollback') { if (initializedHandlesRef.current.has(handle)) return } — initializedHandlesRef is now cleared on reconnect, so the fresh scrollback passes the guard and calls ref.init(cols,rows,serialized).
Typecheck: skipped

Proof (from validator)

  • C2 — proof_type: code_analysis
    • trigger: WebSocket reconnect after a network blip while a terminal is already initialized (initializedHandlesRef populated from prior scrollback).
    • observable: After reconnect, the terminal pane shows stale content from before the disconnect; any output emitted during disconnect (or any post-reconnect resync scrollback) is dropped. xterm is never re-init'd at the fresh dims/serialized payload.
    • path:
      • mobile/app/h/[hostId]/session/[worktreeId].tsx:1455-1462 (post-diff): on connState='connected' the effect now only calls setTerminalsLoaded(false) when initializedHandlesRef.size===0; clearTerminalCache() was removed entirely
      • mobile/src/transport/rpc-client.ts:357-362: on reconnect/e2ee_authenticated the client auto-resends every entry of streamListeners — including terminal.subscribe
      • mobile/app/h/[hostId]/session/[worktreeId].tsx ~638-642 (subscribe handler): if (data.type === 'scrollback') { if (initializedHandlesRef.current.has(handle)) return } — the fresh scrollback snapshot from the new server-side handler is silently dropped

Generated by pr-bug-scan (proof-machine architecture). Human approval required before merge.

Clear initializedHandlesRef on reconnect so the auto-resubscribed scrollback frame re-inits xterm instead of being dropped by the has(handle) guard.
@AmethystLiang
AmethystLiang requested a review from Jinwoo-H May 13, 2026 17:16
@Jinwoo-H
Jinwoo-H merged commit cd4aa06 into main May 13, 2026
4 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Clear initializedHandlesRef on reconnect so the auto-resubscribed scrollback frame re-inits xterm instead of being dropped by the has(handle) guard.

Co-authored-by: orca-bug-scan-bot <[email protected]>
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.

1 participant