SmartProxy icon indicating copy to clipboard operation
SmartProxy copied to clipboard

fix: subscription refresh not happening sometimes

Open WofWca opened this issue 1 year ago • 0 comments

Since the background scripts in MV3 are non-persistent, they might shut down often, losing all setInterval timers.

If the background script doesn't live longer that refresh period, then it will never refresh.

This commit checks lastTryDate and does setTimeout based on that. If the list has not been refreshed for longer than refreshRate, we'll refresh it immediately.

FYI however there is another bug: if a fetch fails, lastTryDate does not get stored in local storage, so a refresh attempt will happen immediately as the background script starts. This is not a big problem.

WofWca avatar Aug 10 '24 14:08 WofWca