Skip to content

refactor(tabs): drop evictAll, which cannot bump the epoch that makes an evicted tab reload - #2066

Merged
datlechin merged 1 commit into
mainfrom
refactor/2060-drop-evictall
Aug 10, 2026
Merged

refactor(tabs): drop evictAll, which cannot bump the epoch that makes an evicted tab reload#2066
datlechin merged 1 commit into
mainfrom
refactor/2060-drop-evictall

Conversation

@datlechin

Copy link
Copy Markdown
Member

Follow-up to #2064, which flagged this and left it alone.

TabSessionRegistry.evictAll(except:) has no production caller. Only its own three tests use it. That alone would be a weak reason to delete a tidy-looking API, so I looked at what it actually does.

It drops a tab's rows and sets isEvicted, but it has no access to the tab manager, so it cannot bump QueryTab.loadEpoch. That epoch is what SwiftUI's .task(id:) keys on, and it is the only thing that makes an evicted tab reload. The one real eviction path pairs the two:

for (index, tab) in tabManager.tabs.enumerated() where ... {
    tabSessionRegistry.evict(for: tab.id)
    tabManager.mutate(at: index) { $0.loadEpoch &+= 1 }
}

evictInactiveTabs in the tab-switch path does the same. So anyone reaching for evictAll because it looks like the batch version of evict would get exactly the wrong result: rows dropped on every background tab, no epoch bumped, and nothing to trigger a refetch. Blank grids that only heal on a manual refresh.

It is not an API waiting for a caller, it is a trap with three tests holding it in place. Removed with them.

Verification

43 tests pass across TabSessionRegistryTableRowsTests, TabSessionRegistryTests, TabSessionTests, TabRetargetSessionStateTests and MainContentCoordinatorLazyLoadTests. swiftlint lint --strict reports 0 violations in 1300 files.

No CHANGELOG entry: removing an uncalled method changes nothing a user can see.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin
datlechin merged commit 1213e77 into main Aug 10, 2026
4 checks passed
@datlechin
datlechin deleted the refactor/2060-drop-evictall branch August 10, 2026 05:41
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