Repository navigation
fix(storage): serialize auth and app check token updates - #16766
dajiaohuang wants to merge 3 commits into
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
I'm new to Swift. What was causing the issue with the request headers? |
|
Thanks for the contribution! A few housekeeping items:
|
paulb777
left a comment
There was a problem hiding this comment.
Thanks. One note on reachability: with the shipping providers, both callbacks already arrive on the main queue. Auth delivers getToken on main, and App Check's callback runs on the Promises default queue, which is main. So this race can only happen if an app changes DispatchQueue.promises (FBLPromise.defaultDispatchQueue) or uses a custom interop provider. Could you mention that in the PR description?
The change itself is safe, and it finally puts the unused serialAuthArgsQueue to work.
|
Both semaphore waits now use two-second timeouts and XCTFail, while resumeBoth still releases both callback permits even after a timeout so the test cannot leave providers blocked indefinitely. Updated the PR description and Unreleased/#16766 changelog to state that concurrent callbacks require custom interop providers or a changed Promises default callback queue; shipping providers normally deliver on main. Kept the existing serialAuthArgsQueue implementation, which you confirmed is safe, rather than switching to the optional notify-block alternative. Pinned SwiftFormat 0.55.5 lint and git diff --check pass. Native Apple XCTest is unrun locally and remains for CI. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request serializes Auth and App Check token header updates in StorageTokenAuthorizer using a serial queue to prevent concurrent mutation of requests, and adds corresponding unit tests. The review feedback recommends increasing the timeout values for semaphores and expectations in the new tests to 5 seconds to avoid potential flakiness on heavily loaded CI environments.
|
The revised bounded-wait regression now runs in the repository's actual Swift Package test target. At source 76fbd7f, StorageAuthorizerTests executed 17 tests with zero failures, including the parallel Auth/App Check header mutation regression: native XCTest results. The PR description retains the custom-provider/default-callback-queue reachability boundary. |
Summary
Validation