-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Hello,
I've noticed that a few race conditions may occur:
-
When renewing expired credentials,
gAuthis updated before generating a new value forjwt. If two tasks happens concurrently and the first one gets preempted after updatinggAuthbut before the newjwthas been written, the second task may assume the expiredjwtis still valid and reuse it, causing an authorization error.- Likelihood: May happen occasionally. A robust application should be able to recover from errors and retry later.
-
When changing the
configuration, existing credentials are not invalidated.- Likelihood: Won't happen when using FCM as described in the documentation.
-
When resetting the
configurationtonil, a fatal error may occur in an ongoing task (includingwarmupCache()) that needsconfigurationto be present.- Likelihood: Won't happen when using FCM as described in the documentation.
-
When using FCM immediately after it was configured,
getAccessToken()may attempt to readgAuthbefore it has been set bywarmupCache(), causing a fatal error.- Likelihood: Very unlikely to happen for an HTTP application. Likely to happen for a CLI application or unit tests that use FCM.
-
When the application is shut down, its storage gets cleared, which may cause a fatal error to occur in an ongoing task (including
warmupCache()) that needsconfigurationorgAuthto be present.- Likelihood: Very unlikely to happen for an HTTP application. Likely to happen for unit tests that configure FCM (even without using it).