GitLiveApp / firebase-kotlin-sdk

A Kotlin-first SDK for Firebase
https://gitliveapp.github.io/firebase-kotlin-sdk/
Apache License 2.0
1.17k stars 155 forks source link

Fixed a crash for settings when iOS would access the same Firebase instance twice #562

Closed Daeda88 closed 4 months ago

Daeda88 commented 4 months ago

Fixes #552

nbransby commented 4 months ago

Why does accessing the same Firebase instance twice crash on iOS?

Daeda88 commented 4 months ago

iOS natively crashes when you change settings after doing something with firstore (e.g. disable the network). But the code contained this to sync settings:

    actual var settings: FirebaseFirestoreSettings = firestoreSettings { }.also {
        native.settings = it.ios
    }

So native settings would be set to firestoreSettings { } whenever a Kotlin FirebaseFirestore instance was created. So if you do:

Firebase.firestore.disableNetwork()
Firebase.firestore.enableNetwork()

What happens is:

Something similar is happening on JS as per #551, Ill try and create a fix for that one too

Daeda88 commented 4 months ago

Latest commit adds a test & fixes #551

Tweener commented 3 months ago

Hi 👋 I'm also having the same issue on iOS. Do you guys have an idea when a new release can be expected? Thanks!

Btw, love the work you guys have been doing with this library! 🫶