Skip to content

fix(#120): remove duplicate ipcMain.on listener for visualizer-settings:update#139

Open
anshul23102 wants to merge 1 commit into
SamXop123:mainfrom
anshul23102:fix/120-remove-duplicate-ipc-listener
Open

fix(#120): remove duplicate ipcMain.on listener for visualizer-settings:update#139
anshul23102 wants to merge 1 commit into
SamXop123:mainfrom
anshul23102:fix/120-remove-duplicate-ipc-listener

Conversation

@anshul23102
Copy link
Copy Markdown

Summary

main.js registered two competing listeners on the visualizer-settings:update IPC channel simultaneously: an ipcMain.on (fire-and-forget) and an ipcMain.handle (request-response). On every settings update from the renderer both handlers fired, calling updateSettings(patch) twice per message and writing the patch to disk twice. Errors thrown inside the ipcMain.on callback were silently discarded with no propagation back to the renderer, making the channel unreliable.

Closes #120

Root Cause

// Added first - fire-and-forget, errors swallowed
ipcMain.on('visualizer-settings:update', (event, patch) => {
  updateSettings(patch);
});

// Added later - request-response, returns updated state
ipcMain.handle('visualizer-settings:update', (_event, patch) => {
  updateSettings(patch);
  return getRendererSettings();
});

Both execute on every ipcRenderer.invoke('visualizer-settings:update', patch) call.

Fix

Removed the ipcMain.on registration. The ipcMain.handle registration is the correct pattern for this channel: it applies the patch once, persists it, and returns the updated settings object to the renderer as the invoke reply.

Files Changed

  • main.js: Removed the 4-line ipcMain.on('visualizer-settings:update', ...) block.

How to Test

  1. Open Paraline settings and change any setting (e.g. toggle a theme option).
  2. Verify the change is applied and persisted exactly once.
  3. Verify the settings window reflects the updated state correctly on the same interaction.

Checklist

  • Single targeted removal with no side effects on other channels.
  • The remaining ipcMain.handle registration provides full update semantics.
  • No new dependencies or logic changes.

…alizer-settings:update

Two listeners were registered on the same visualizer-settings:update channel:

  ipcMain.on('visualizer-settings:update', ...)   // fire-and-forget, no error handling
  ipcMain.handle('visualizer-settings:update', ...)  // request-response, returns updated state

On every settings update from the renderer both handlers fired, calling
updateSettings(patch) twice and applying the patch to disk twice per message.
Errors thrown inside the ipcMain.on callback were silently swallowed because
fire-and-forget listeners have no error propagation path back to the renderer.

Removed the ipcMain.on registration. The ipcMain.handle registration is the
correct pattern for this channel: it applies the patch once, persists it, and
returns the updated settings object to the renderer as the invoke reply.

Fixes SamXop123#120
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@anshul23102 is attempting to deploy a commit to the Dot_NotSam's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Warning

Review limit reached

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

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

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

⌛ 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.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 36ef791c-3d49-44e6-80aa-ff9efd71559d

📥 Commits

Reviewing files that changed from the base of the PR and between 3e9da7b and 723684a.

📒 Files selected for processing (1)
  • main.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant