Refactor Electron startup boot sequence#280
Conversation
|
Warning Review limit reached
More reviews will be available in 54 minutes and 40 seconds. Learn how PR review limits work. To continue reviewing without waiting, enable usage-based billing in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository: wcpos/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4426f45681
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| constructor(mainWindow: BrowserWindow) { | ||
| this.targetPath = ''; | ||
| this.mainWindow = getMainWindow(); | ||
| this.mainWindow = mainWindow; |
There was a problem hiding this comment.
Clear stale updater window after close
On macOS the app intentionally stays running after window-all-closed; with this assignment the updater keeps a reference to the first BrowserWindow even after it has emitted closed. If the user closes the last window and then uses the still-present app menu to check for updates, or the hourly update interval finds one before the app is reactivated, manualCheckForUpdates/confirmUpdateDialog pass a destroyed window into dialog.showMessageBox, so the update UI can fail instead of showing an unparented dialog. Clear or validate the stored window on close before using it.
Useful? React with 👍 / 👎.
Summary
src/main/boot.tswith an explicit, dependency-injected boot plan andAppContextfor startup wiring.app.whenReady().then(...)chain withboot(bootDeps)while preserving the existing phase order and dev-only protocol handling.nullat module import time.ts-nodeboot smoke test and wires it intopnpm test.Design decisions (preserve through rebases)
bootPlan(deps)is exported as ordered data — startup ordering is now inspectable/testable without launching Electron.getMainWindow()remains as a shim — late event-time lookups like power resume stay behavior-preserving while constructor-time ambient grabs are removed.updaterremains a stable menu-facing handle — menu call sites keep working while the realAutoUpdaterinstance is configured post-window.Test plan
pnpm --config.verify-deps-before-run=false run ts:checkpnpm --config.verify-deps-before-run=false run lint(exits 0; existing warnings remain)pnpm --config.verify-deps-before-run=false run test:bootpnpm --config.verify-deps-before-run=false testpnpm --config.verify-deps-before-run=false run devreached Electron startup,Starting app, auth handler initialization, development updater no-op, renderer bundle load, and hydration logs. API session could not visually click the menu/dialog.dist/is present. In this worktree,pnpm --config.verify-deps-before-run=false run packagereached Forge finalization but failed withENOENT ... lstat .../distbecause the rendererdist/directory was absent.🤖 Generated with Claude Code