Skip to content
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

bug: iOS swift concurrency EXC_BAD_ACCESS in Firestore addCollectionSnapshotListener #771

Closed
5 of 17 tasks
TomCarey opened this issue Dec 11, 2024 · 0 comments · Fixed by #772
Closed
5 of 17 tasks
Labels

Comments

@TomCarey
Copy link
Contributor

Plugin(s)

  • Analytics
  • App
  • App Check
  • Authentication
  • Crashlytics
  • Cloud Firestore
  • Cloud Functions
  • Cloud Messaging
  • Cloud Storage
  • Performance
  • Remote Config

Version

6.2.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

When calling FirebaseFirestore.addCollectionSnapshotListener in a useEffect that appropriately removes the snapshot listener when unmounting I sometimes get a crash in the iOS plugin FirebaseFirestore.swift:244 where there is a bad access due to a concurrent write on a dictionary that isn't thread safe.

Expected behavior

It should not crash. It should ensure all read/write operations are performed in a thread-safe manor.

Reproduction

https://github.com/capawesome-team/.capacitor-app

Steps to reproduce

Sorry, I don't have capacity to set this up in an example since it doesn't always happen (threading race condition)

Other information

I have a fix ready to be turned into a PR that manages the listenerRegistrationMap by wrapping it with an actor

Capacitor doctor

This isn't relevant

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants