-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Replace setInterval with chrome alarms for MetaMetrics FinalizeEventFragment #16003
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
); | ||
|
||
if (hasAlarm) { | ||
Object.values(this.store.getState().fragments).forEach( |
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.
Can we make this Object.values.forEach
block a helper function? It looks duplicated here and within the setTimeout
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.
@NiranjanaBinoy we could make a 'finalizeAbandonedFragments' method that does this.
Builds ready [c8b3f43]
Page Load Metrics (2226 ± 65 ms)
highlights:storybook
|
Builds ready [0e7be61]
Page Load Metrics (2415 ± 69 ms)
highlights:storybook
|
Explanation
We are replacing setInterval with chrome alarm to schedule the call to
FinalizeEventFragment()
every 1 min. The current interval window for FinalizeEventFragment() is 30 sec; we are updating that to 1 min since chrome alarms require the interval to be at least 1 mins and replace setInterval with chrome alarms.More Information
Fixes #15933
Screenshots/Screencaps
Before
After
Manual Testing Steps
chrome.alarm.onalarm.addListener()
and insidegetall()
to verify the alarm is getting triggered at 1 mins interval.Pre-Merge Checklist
+ If there are functional changes: