Skip to content

Crash Due to Dispatch Group Over-Release with Multiple fetchCompletionHandler Calls #217

Description

@pletoss

We’ve observed a crash when integrating FirebaseMessaging / GoogleUtilities with the Braze Unity SDK. The issue appears to stem from using a dispatch group in the swizzled AppDelegate: if fetchCompletionHandler is invoked more than once (a behavior not explicitly disallowed by Apple’s docs), an imbalance occurs calling dispatch_group_leave more times than dispatch_group_enter triggers an exception.

References

Related issues:

  1. Intercom SDK Discussion
  2. Firebase iOS SDK Issue #8442
  3. Braze Unity SDK Issue #10

Suggested Resolution

Clarify (via Apple’s documentation or internal assumptions) whether fetchCompletionHandler is allowed to be called multiple times, or adjust GoogleUtilities to safely handle multiple invocations. This change would prevent not only the current crash but also avoid hard-to-debug issues with other libraries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions