Fix focusedWaveWindow (also fixes bug w/ save session as....)#2987
Fix focusedWaveWindow (also fixes bug w/ save session as....)#2987
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughIPC handlers for saving images and text were changed to resolve the parent BrowserWindow dynamically using BrowserWindow.fromWebContents(event.sender) (or event.sender.hostWebContents) instead of relying on a previously imported focused window. The function saveImageFileWithNativeDialog now accepts a sender parameter and resolves the target window from it with null-checks. All IPC call sites were updated to pass the appropriate sender. The webview-image-contextmenu IPC path and save-text-file handler were updated accordingly. Separately, the WaveBrowserWindow focus handler now assigns the global focusedWaveWindow = this when a window gains focus. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@emain/emain-ipc.ts`:
- Around line 133-145: In saveImageFileWithNativeDialog, the code returns when
electron.BrowserWindow.fromWebContents(sender) yields null without disposing
readStream; call readStream.destroy() (or readStream.close() if supported)
before returning to free buffered data and listeners. Update the ww == null
branch in saveImageFileWithNativeDialog to destroy the Readable
(readStream.destroy()) and then return, ensuring no leaked resources.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 080a430d-eeff-48e8-a48f-95b0cb95326c
📒 Files selected for processing (2)
emain/emain-ipc.tsemain/emain-window.ts
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Overview
NotesThe PR correctly fixes the The existing CodeRabbit comment (line 146) regarding readStream resource cleanup has been addressed - the code now properly calls Files Reviewed (2 files)
|
No description provided.