这是indexloc提供的服务,不要输入任何密码
Skip to content

[Auth] Reduce callback nesting #15079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 4, 2025
Merged

[Auth] Reduce callback nesting #15079

merged 2 commits into from
Jul 4, 2025

Conversation

ncooke3
Copy link
Member

@ncooke3 ncooke3 commented Jul 4, 2025

Potential fix for #14962. The stack trace looks like the interop's completion handler is released twice:

Crashed: com.google.firebase.auth.globalWorkQueue
0  libobjc.A.dylib                0x1b50 objc_release_x0 + 16
1  libobjc.A.dylib                0x1b50 objc_release + 16
2  Porter                         0xd61c2c closure #1 in Auth.getToken(forcingRefresh:completion:) + 1594 (User.swift:1594)
3  Porter                         0x14880 thunk for @escaping @callee_guaranteed @Sendable () -> () + 4306913408 (<compiler-generated>:4306913408)
4  libdispatch.dylib              0x1aac _dispatch_call_block_and_release + 32
5  libdispatch.dylib              0x1b584 _dispatch_client_callout + 16
6  libdispatch.dylib              0xa2d0 _dispatch_lane_serial_drain + 740
7  libdispatch.dylib              0xadac _dispatch_lane_invoke + 388
8  libdispatch.dylib              0x151dc _dispatch_root_queue_drain_deferred_wlh + 292
9  libdispatch.dylib              0x14a60 _dispatch_workloop_worker_thread + 540
10 libsystem_pthread.dylib        0x4660 _pthread_wqthread + 292
11 libsystem_pthread.dylib        0x19f8 start_wqthread + 8

The Auth interop's Swift implementation is being passed a completion from an Objective-C++ context (Firestore). My hunch is that Swift implementation's wrapper is confusing the memory management in the handoff of the ObjC impl. callback to the Swift Task scope.

Here is the difference in the call stack:

- Task -> wrapper closure -> DispatchQueue.main.async -> original callback
+ Task  -> DispatchQueue.main.async -> original callback

Fixes #14962

Copy link
Contributor

Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize 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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

@ncooke3 ncooke3 merged commit 8bf009c into main Jul 4, 2025
58 checks passed
@ncooke3 ncooke3 deleted the nc/auth-14962 branch July 4, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash while fetching the auth token
3 participants