refactor(events): scope queryHistoryDidUpdate and linkedSQLFoldersDidUpdate by connection id#1161
Merged
datlechin merged 1 commit intoMay 9, 2026
Conversation
…Update by connection id
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.
Summary
Two more
Void-payloadAppEventssubjects with per-connection subscribers gain aUUID?payload, matching the pattern from PRs #1159 and #1160.queryHistoryDidUpdatePassthroughSubject<Void, Never>->PassthroughSubject<UUID?, Never>.QueryHistoryManager.addHistory(...)sendsentry.connectionId(history entries always carry a non-nilconnectionId).deleteHistory(id:)andclearAllHistory()sendnil(the connection isn't easily recoverable from the id-only delete API;clearAllHistorylegitimately spans all connections).HistoryPanelViewis per-connection and now skips events that don't match itsconnectionId.Previously, executing a query on connection A reloaded every other open window's history panel.
linkedSQLFoldersDidUpdatePassthroughSubject<Void, Never>->PassthroughSubject<UUID?, Never>.SQLFolderWatcher.scheduleFullRescan(...)andscheduleDebouncedRescan()rescan across all enabled folders, so they always sendnil. The shape change is forward-looking so any future per-folder rescan path can carry the affected connection id without re-shaping the bus.ConnectionDataCache,MainContentCoordinator.checkOpenTabsForExternalModification, andSQLEditorViewnow applypayload == nil || payload == self.connectionId. Today every event still carriesnilso the filter is a no-op for the rescan path; once any sender starts emitting a specific id (e.g. a future per-folder reload), per-connection subscribers will short-circuit unrelated events automatically.Why this matters
Audit X-shape pattern, continuing the work in PRs #1148, #1159, #1160. After this PR the only remaining
Void-payload subjects onAppEventsare genuinely global (themeChanged,accessibilityTextSizeChanged,editorSettingsChanged,dataGridSettingsChanged,aiSettingsChanged,terminalSettingsChanged,licenseStatusDidChange,syncChangeTracked,mcpAuditLogChanged,pluginsRejected,linkedFoldersDidUpdate,mainWindowWillClose).Test plan
nil).