Conversation
- Ensure `HighlightObserver` stops prior observer instances before starting a new one. - Correctly unregister `chrome.storage.onChanged` listener in `SmartCaptureMode` and clear animation frames on `destroy`. - Clear `setTimeout` and `setInterval` on component unmount in `SavedLinkCard` and `useThumbnail`. - Use `cancelled` flags to prevent state updates on unmounted React components. Co-authored-by: fklnc94 <164671181+fklnc94@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This change fixes several potential memory leaks found in the extension:
highlightObserver.ts: Thestartfunction now callsstop()if it's already observing, preventing multipleMutationObserverinstances and stale timers.SmartCaptureMode.ts: Fixed thedestroymethod to explicitly clearanimationFrameIdand remove thechrome.storage.onChangedlistener to prevent memory leaks from unused listeners and active animation frames holding onto detached DOM nodes.SavedLinkCard.tsx: Correctly trackstimeoutIdandpollIntervalto clear them when the component unmounts.useThumbnail.ts: Correctly added acancelledflag to theuseEffecthook to prevent state updates after unmount, and cleared the polling interval upon component unmount.PR created automatically by Jules for task 7035002435365596964 started by @fklnc94