-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix: Heap usage request throttling #1450
Conversation
c115118
to
c62babd
Compare
8c34703
to
96e4cb7
Compare
Codecov Report
@@ Coverage Diff @@
## main #1450 +/- ##
==========================================
+ Coverage 45.70% 45.75% +0.05%
==========================================
Files 513 515 +2
Lines 35046 35073 +27
Branches 8781 8784 +3
==========================================
+ Hits 16017 16048 +31
+ Misses 18978 18974 -4
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more.
|
'ms elapsed since last tick.' | ||
); | ||
|
||
await callback(); |
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.
If the component unmounts during this callback, I think the timer will continue on - it returns from this callback, and there's nothing to stop it from calling window.setTimeout
at the end.
Should set an isCancelled
ref when unmounted, or you could overload the setTimeoutRef
instead.
fixes #1439 - Heap usage code now guarantees that new requests won't be scheduled until all previous requests are complete.
Testing
I tested by shutting my Mac for ~2 hours and returning. Timings looks something like this:
Summary
It seems that requests still happen occasionally while sleeping. On Wake up, there were a few ticks resulting in "Unable to get heap usage" console errors. Then a prompt showed up indicating credentials had expired at which point requests start succeeding again.
Full Console Log