Hi Jake,
We have implemented appAuthHelper and OIDC session check and all is mostly working well, however, we observe random instances of the service worker failing to intercept fetch requests.
We are tracking requests to our APIs where the authorization header / bearer token is missing and this is running at around 3% failure rate.
Our theory is the service worker is being terminated even with the keepAlive messages.
I have seen this via a screen share and I can replicate this by stopping the service worker under Chrome.

Now identityProxy is undefined.

|
if (self.identityProxy) { |
You have code to check if the worker is alive and re-register it here, but the re-registration never fires as savedReg is still active.
|
if (savedReg && savedReg.active) { |
|
// prevents the service worker thread from becoming idle and losing |
|
// the references we just passed into it. |
|
savedReg.active.postMessage({"message": "keepAlive"}); |
|
} else { |
|
// In case the service worker still somehow manages to become inactive, |
|
// re-registers it. |
|
registerServiceWorker().catch((function () { |
One thought I had was the keepAlive message could post the appAuthConfig in each time and instantiate a new IdentityProxyServiceWorker if identityProxy is undefined.
Thanks
Hi Jake,
We have implemented appAuthHelper and OIDC session check and all is mostly working well, however, we observe random instances of the service worker failing to intercept fetch requests.
We are tracking requests to our APIs where the authorization header / bearer token is missing and this is running at around 3% failure rate.
Our theory is the service worker is being terminated even with the keepAlive messages.
I have seen this via a screen share and I can replicate this by stopping the service worker under Chrome.

Now identityProxy is undefined.

appAuthHelper/appAuthServiceWorkerCore.js
Line 34 in 7e86700
You have code to check if the worker is alive and re-register it here, but the re-registration never fires as savedReg is still active.
appAuthHelper/appAuthHelper.js
Lines 292 to 299 in 22ecd99
One thought I had was the keepAlive message could post the appAuthConfig in each time and instantiate a new IdentityProxyServiceWorker if identityProxy is undefined.
Thanks