-
Notifications
You must be signed in to change notification settings - Fork 449
Add progress tracking for downloads and model states #2470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Warning Rate limit exceeded@ComputelessComputer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 42 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
✨ 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 |
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| 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 () => {}; |
There was a problem hiding this comment.
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.
| 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
Is this helpful? React 👍 or 👎 to let us know.
Overview
Details