csfloat / extension

Source Code that Powers the CSFloat Extensions
https://csfloat.com
MIT License
98 stars 20 forks source link

Reschedule Alarm If Far Off into the Future #221

Closed Step7750 closed 6 months ago

Step7750 commented 6 months ago

Came across a case where the user was changing their clock on their device into an inaccurate time into the future.

They then enabled "offer tracking" in the extension, which caused Chrome to queue up the next scheduled run of the alarm at this future UNIX timestamp (NOW() + 1 minute).

They then proceeded to correct their device time back to the correct time, which caused the next run to be scheduled for 1d+ in the future.

To help prevent this, the service worker can look at currently registered alarms and their next schedule time -- and if it's too far into the future, reschedule them.