fix(main): migrate remaining window fan-outs to guarded broadcastToAllWindows - #937
Draft
h4yfans wants to merge 2 commits into
Draft
fix(main): migrate remaining window fan-outs to guarded broadcastToAllWindows#937h4yfans wants to merge 2 commits into
h4yfans wants to merge 2 commits into
Conversation
…lWindows Follow-up to #935: replace ~30 unguarded BrowserWindow.getAllWindows() + webContents.send() fan-out sites across ipc/, vault/, sync/, import/, and test-hooks with broadcastToAllWindows(), which skips destroyed windows and webContents. Window-selection sites (find/filter/[0]/length) are untouched. The helper's data param is now optional for the zero-payload quick-capture:open broadcast. Test electron mocks gain isDestroyed guards per the #935 idiom.
h4yfans
force-pushed
the
window-broadcast-fanout-remaining
branch
from
August 3, 2026 17:20
9c51ae4 to
18435ce
Compare
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This was referenced Aug 7, 2026
Merged
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.
Follow-up to #935. Migrates the remaining ~30 unguarded
BrowserWindow.getAllWindows()+webContents.send()fan-out sites in the main process tobroadcastToAllWindows(channel, data?), which skips destroyed windows and webContents. Unguarded sends against destroyed short-lived windows (splash, quick capture, print/export) throw, and inside sync item handlers that throw rolls back the applied item's DB transaction.Scope
quick-capture:openshortcut callback), sync-attachment-handlers (4), auth-oauth-handlers (2), auth-device-handlers (2), sync-core, bookmarks, canvas, tags, saved-filters, journal, calendar, ai-inline, localeHelper change:
dataparam is now optional for the zero-payloadquick-capture:openbroadcast.Left untouched by design: window-selection sites (find/filter/[0]/length/fromWebContents) in agent-handlers, agent-lazy-handlers, canvas-handlers close-listener bookkeeping, menu.ts, and all index.ts sites. Files covered by #935 are not touched here — no overlap, either PR can land first.
Test mocks: electron mocks returning bare
{ webContents: { send } }windows now needisDestroyed: () => falseat window and webContents level (same idiom as #935); ~30 test files updated accordingly.Verification
pnpm --filter @memry/desktop typecheck:nodecleanpnpm --filter @memry/desktop test:main: 415 files / 4497 tests passed (one expectation updated: the zero-payload broadcast now sends an explicitundefinedpayload arg)pnpm docs:impact --base origin/main --strictgreen (apps/docs/src/architecture/ipc.md updated);pnpm docs:buildgreen