Skip to content

fix: address audit findings (ESC logic, IPC types, update UX, mutex safety, ESLint)#68

Merged
VariableThe merged 3 commits into
mainfrom
fix/audit-findings
Jun 27, 2026
Merged

fix: address audit findings (ESC logic, IPC types, update UX, mutex safety, ESLint)#68
VariableThe merged 3 commits into
mainfrom
fix/audit-findings

Conversation

@VariableThe

Copy link
Copy Markdown
Owner

Changes

Fixes all issues found in the code quality audit:

🔴 Correctness Bugs

ESC key closes window before dismissing overlays (useGlobalHotkey.ts)

  • Restructured ESC handler to dismiss overlays in priority order first (action menu → search → graph)
  • Added showTimersView / showRemindersView checks so ESC defers to those panels' own handlers
  • Window only hides as a final fallback when no overlay is open

IPC void methods silently swallowed errors (types.d.ts, api.ts)

  • Changed quitApp, openExternal, openFile, setLaunchAtStartup from voidPromise<void>
  • setLaunchAtStartup now returns the invoke Promise instead of fire-and-forget

Silent auto-restart on update (system.rs)

  • Download+install now runs in a background Tokio task
  • Emits update-ready event to the frontend before restarting
  • Waits 3 seconds so the user sees the toast
  • Added onUpdateReady IPC channel (both types.d.ts and api.ts)
  • App.tsx listens and shows: "✨ PaperCache updated — restarting in 3 seconds…"

🟡 Robustness

Mutex unwrap() panics in shortcuts.rs — replaced with .map_err(|e| e.to_string())?

Dead-end Pause button (TimersPage.tsx)

  • Removed the ⏸ pause button since resumeTimer has no backend implementation
  • A button with no un-pause path is worse UX than no button at all

macOS AppHandle memory leak (macos.rs)

  • Documented the intentional Box::into_raw leak with a safety comment explaining the lifetime requirement

🟢 Hygiene

ESLint warnings in GraphView.tsx — both resolved:

  • Added a minimal ForceGraphInstance interface replacing the any ref type
  • Snapshotted fgRef.current inside the effect body to fix the stale-ref cleanup warning

react / react-dom moved from devDependenciesdependencies

Checks

  • npm run lint — ✅ 0 errors, 0 warnings (was 2 warnings)
  • npx tsc --noEmit — ✅ 0 errors
  • npx vitest run — ✅ 35/35 tests passing

Not addressed (scope / complexity)

  • Eager full-content read on startup (fs.rs walk_dir) — architectural change requiring frontend refactor; tracked separately
  • reqwest 0.11 → 0.12 bump — breaking API change; tracked separately

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@VariableThe, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 37 minutes and 56 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 review availability.

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, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 58103d0a-d3a6-4f3e-83fa-383c1c1ae552

📥 Commits

Reviewing files that changed from the base of the PR and between df57386 and d72a302.

📒 Files selected for processing (12)
  • AUDIT_LOG.md
  • CHANGELOG.md
  • package.json
  • src-tauri/src/commands/shortcuts.rs
  • src-tauri/src/commands/system.rs
  • src-tauri/src/macos.rs
  • src/App.tsx
  • src/GraphView.tsx
  • src/api.ts
  • src/components/TimersPage.tsx
  • src/hooks/useGlobalHotkey.ts
  • src/types.d.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/audit-findings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VariableThe VariableThe merged commit 19fa5da into main Jun 27, 2026
4 checks passed
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