fix: move single-instance lock before whenReady + branch protection#216
Conversation
The lock was acquired at line 826, after app.whenReady().then() was registered at line 510. On a secondary launch, the whenReady callback could fire before app.quit() takes effect, causing two processes to touch the same SQLite database and register duplicate IPC handlers. Now the lock is acquired at module top-level (before whenReady), with an extra guard inside the callback. Secondary instances quit before any initialization occurs. Also configured GitHub branch protection rules for develop and main: - Required status checks: lint, test, typecheck - PRs required (0 approvals — allows self-merge but blocks direct push) - No force pushes or deletions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 29 minutes and 56 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…e-lock-and-branch-protection
#217) ## Patch v0.12.1 Critical fixes since v0.12.0: ### Bug Fixes - **Fix "Object has been destroyed" crash on update** — safe broadcast helper with double isDestroyed check + try/catch (#213) - **Move single-instance lock before whenReady()** — prevents secondary instances from initializing DB/IPC (#216) ### Architecture Refactor - **main/index.ts**: 3,046 → 887 lines (10 IPC handler modules) (#214) - **preload/index.ts**: 1,227 → 161 lines (14 API modules) (#215) - **App.tsx**: 1,010 → 643 lines (4 hooks extracted) (#215) - **PluginsSection.tsx**: 1,043 → 11 lines (3 sub-components) (#215) - **syncService.ts**: 1,065 → 18 lines (types + helpers extracted) (#215) ### CI Improvements - Fix Linux build: expanded cache cleanup, removed corrupted fpm (#212) - Remove broken dart-actions/tweet action (#210) - Node.js 24 via FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 (#212) - Branch protection configured on develop + main (#216) ## Test plan - [x] `pnpm typecheck` — 17/17 pass - [x] `pnpm test` — 16/16 pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary
Single-instance lock: Moved
requestSingleInstanceLock()beforeapp.whenReady()to prevent secondary instances from initializing DB, IPC handlers, and auto-updater beforeapp.quit()takes effect.Branch protection: Configured via GitHub API for both
developandmain:Test plan
pnpm typecheck— 17/17 pass🤖 Generated with Claude Code