google / google/app-check

AppCheck `token(forcingRefresh: true)` returns cached token if `token(forcingRefresh: false)` in progress

Open
#42 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
45
Forks
25
Avg merge
1d 6h
Merged PRs (30d)
10

Description

Calls to [`token(forcingRefresh:)`](https://github.com/google/app-check/blob/5746b2d35c91c50581590ed97abe4c06b5037274/AppCheckCore/Sources/Public/AppCheckCore/GACAppCheck.h#L38-L40) with `forcingRefresh: true` may return a cached token if a call is already in progress where `forcingRefresh: false`. This may be as simple as adding `|| forcingRefresh` to `if (self.ongoingRetrieveOrRefreshTokenPromise == nil)` (see below) but needs testing.

https://github.com/google/app-check/blob/5746b2d35c91c50581590ed97abe4c06b5037274/AppCheckCore/Sources/Core/GACAppCheck.m#L138-L153

Note: this issue isn't new (already exists in FirebaseAppCheck [10.17.0](https://github.com/firebase/firebase-ios-sdk/blob/8872dbd7d947acf757abab933da10e83c1842280/FirebaseAppCheck/Sources/Core/FIRAppCheck.m#L266-L282)) but the code has moved to this repo.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.