You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Too much failed requests when trying to fetch OidcKeepAliveServiceWorker.json, that leads to bunch of errors in network tab and console logs. Also process is random and sometimes it could stay clean for some time.
To Reproduce
You need just run OIDC client with tokens refresh and wait until OidcKeepAliveServiceWorker will start randomly write error logs
Versions
Latest
Screenshots
Expected
Library should not spam error logs into console, especially when error is random and does not impact on app. This is confusing
Actual
Too much errors in browser.
Additional Details
In OidcServiceWorker.ts there is a function keepAlive and it has this randomiser:
And it is weird, that random function over 150 times resolves into same values (like we have always sleep(2000) result). Here, my assumption, this also might be related to sleep function implementation. As it triggers setTimeout, there is no guarantee that this timeout will be executed immediately, as other functions in app/service worker could also inject some functions into browser call stack. So that leads to longer delays.
This leads to situation when network tab and console are overwhelmed with errors, as this timer:
always higher then Firefox threshold
regularly (but randomly) exceed 5min in Chrome
Proposals
Not sure what could be better, but some ideas:
make it configurable from client side
make it adjustable according to different browsers limits
just make it once per 25 sec without any randomizer
The text was updated successfully, but these errors were encountered:
wermanoid
changed the title
Too many false negative OidcKeepAliveServiceWorker fetches
Too many logs and errors for OidcKeepAliveServiceWorker fetches
Apr 17, 2024
Issue and Steps to Reproduce
Too much failed requests when trying to fetch
OidcKeepAliveServiceWorker.json
, that leads to bunch of errors in network tab and console logs. Also process is random and sometimes it could stay clean for some time.To Reproduce
You need just run OIDC client with tokens refresh and wait until
OidcKeepAliveServiceWorker
will start randomly write error logsVersions
Latest
Screenshots
Expected
Library should not spam error logs into console, especially when error is random and does not impact on app. This is confusing
Actual
Too much errors in browser.
Additional Details
In OidcServiceWorker.ts there is a function keepAlive and it has this randomiser:
Problem is next:
And it is weird, that random function over 150 times resolves into same values (like we have always
sleep(2000)
result). Here, my assumption, this also might be related tosleep
function implementation. As it triggers setTimeout, there is no guarantee that this timeout will be executed immediately, as other functions in app/service worker could also inject some functions into browser call stack. So that leads to longer delays.This leads to situation when network tab and console are overwhelmed with errors, as this timer:
Proposals
Not sure what could be better, but some ideas:
The text was updated successfully, but these errors were encountered: