Skip to content

Add progress tracking for downloads and model states#2470

Closed
ComputelessComputer wants to merge 1 commit intomainfrom
feat/progress-tracking-banner
Closed

Add progress tracking for downloads and model states#2470
ComputelessComputer wants to merge 1 commit intomainfrom
feat/progress-tracking-banner

Conversation

@ComputelessComputer
Copy link
Collaborator

@ComputelessComputer ComputelessComputer commented Dec 22, 2025

to show download progress in main app with inside a toast, after downloading ai models in onboarding
related: #2468

flow: download model in onboarding -> shows download progress toast in main window

@netlify
Copy link

netlify bot commented Dec 22, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit e176f45
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6949295b1037da00083fd70d
😎 Deploy Preview https://deploy-preview-2470--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 22, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit e176f45
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6949295be2db6b0008fd2cb9
😎 Deploy Preview https://deploy-preview-2470--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines +159 to +169
if (!globalShowBanner && !globalBannerTimer) {
globalBannerTimer = setTimeout(() => {
globalShowBanner = true;
setShowBanner(true);
globalBannerTimer = null;
}, BANNER_CHECK_DELAY_MS);
} else if (globalShowBanner) {
setShowBanner(true);
}, BANNER_CHECK_DELAY_MS);
}

return () => clearTimeout(timer);
return () => {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memory leak: The cleanup function no longer clears the timer when the component unmounts. If the component unmounts before BANNER_CHECK_DELAY_MS expires, the timer will continue to run and call setShowBanner(true) on an unmounted component, causing a React warning and potential memory leak.

Fix:

return () => {
  if (globalBannerTimer) {
    clearTimeout(globalBannerTimer);
    globalBannerTimer = null;
  }
};

The global timer needs to be properly cleaned up to prevent the callback from executing after unmount.

Suggested change
if (!globalShowBanner && !globalBannerTimer) {
globalBannerTimer = setTimeout(() => {
globalShowBanner = true;
setShowBanner(true);
globalBannerTimer = null;
}, BANNER_CHECK_DELAY_MS);
} else if (globalShowBanner) {
setShowBanner(true);
}, BANNER_CHECK_DELAY_MS);
}
return () => clearTimeout(timer);
return () => {};
if (!globalShowBanner && !globalBannerTimer) {
globalBannerTimer = setTimeout(() => {
globalShowBanner = true;
setShowBanner(true);
globalBannerTimer = null;
}, BANNER_CHECK_DELAY_MS);
} else if (globalShowBanner) {
setShowBanner(true);
}
return () => {
if (globalBannerTimer) {
clearTimeout(globalBannerTimer);
globalBannerTimer = null;
}
};

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@ComputelessComputer
Copy link
Collaborator Author

dupe #2671

@ComputelessComputer ComputelessComputer deleted the feat/progress-tracking-banner branch December 30, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant