Repository navigation
fix(native): dedupe thread opens and keep local recents - #260
Merged
Merged
Conversation
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.
Quickly returning to a native thread currently sends another open, and its local recency is lost when the sidebar controller resets. The controller also waits for a usable shell before claiming an open and can accept a delayed callback from an earlier mount of the same thread.
This ports the main-view open path from
threadVisits.ts/threadSearch.ts: claim on mount before shell arrival, dedupe opens for ten minutes by the client clock, and retain local recency even when no command is needed. One bounded, app-owned history survives sidebar and connection resets and feeds the existing palette ranking. Saved-entry namespaces bind their first known canonical identity without remounting; a different known server identity invalidates the namespace. Timers are canceled on shell/selection changes and checked against environment, connection, mount, and shell revision before dispatch. Existing highest-seen watermark, sticky unread, throttle, completion/wake handling, and older-row lookup remain intact.Related to #228. TV-WATERMARK stays partial and #228 stays OPEN. Remaining work: query-bearing palette analytics, side-chat visit subscriptions, and legacy-server capability/local-watermark support. History is process-local and bounded to 4,096 open entries and 4,096 environment bindings; new keys can evict oldest local history. No broader palette, remote/relay/multi-device, performance, or full-frame visual parity claim.
Validation after the last edit:
cargo test --workspace(1,400 tests); six focused tests with--features snapshot, including an AppState GPUI entity/reset test without an OS window.packages/client-runtime.check:changedagainst the supplied base is RED on the inherited ledger formatting. The baseline ledger fails the same check. Rustfmt actually checked all four changed Rust files; the inherited app-file formatting remains RED on both baseline and final sources. Owned new blocks and the core file were formatted without rewriting unrelated app code. The staged autoformatter hook is skipped for the commit because it would reformat unrelated ledger rows; the explicit checks above are retained. No repo-wide fallback command was used. The initial defaultcheck:changedcomparison included pre-existing native history; its full output and interrupt attempt are preserved.Behavioral evidence is pre-RPC: the original controller extraction compiled and failed on missing pre-shell mount and duplicate reopen; restored old timer and palette projections compiled and failed on stale dispatch and recent ordering. Tests now exercise before/at ten minutes, skipped-open recency, unknown/known identities, environment separation/replacement, A→B→A/reconnect, sticky unread after older shells, stale timer guards, and reset lifetime. Intermediate malformed-fixture and missing-GPUI-theme failures are retained, not treated as bug reproduction.
Immutable per-round source copies/manifests, patches, argv/cwd/start/end/exit records, raw logs, binary hashes, and published Git binding are under
/private/tmp/native-factory-2f5f764a/228open-evidence/. Build receipts identify the actual base HEAD at build time and the working source hashes; the later commit is verified against those bytes, not described as having existed during compilation.No live visit/mark-unread/refresh, provider turn, settings/auth change, new server, real window, computer use, or browser automation was used as proof. No screenshot is presented as a reproduction: the existing bounded snapshot hooks do not expose this switching/history scenario without selecting real threads, and no new production fixture hook was added. Known #202 remains outside this slice; no visual repair is claimed.
Built with GPT-6.1 Sol in Codex