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

[iOS] FireStore keep on using CPU #10168

Closed
shohe opened this issue Sep 3, 2022 · 6 comments · Fixed by #10170 or #10173
Closed

[iOS] FireStore keep on using CPU #10168

shohe opened this issue Sep 3, 2022 · 6 comments · Fixed by #10170 or #10173

Comments

@shohe
Copy link

shohe commented Sep 3, 2022

Description

I'm using FireStore at my current iOS project and I realized that when generate CollectionReference or DocumentReference, FireStore starts keep on using CPU (around 10%) until app close.

I'm using

  • Firebase 9.5.0
  • install with SwiftPackageManager
  • Xcode version 13.4.1 (13F100)

Here is sample code (same as document).

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    FirebaseApp.configure()
    let db = Firestore.firestore()
    db.collection("Collection").document("test").setData(["lastLoginAt":Date()], merge: true)

    // Even this code happens issue ↓
    // let ref = db.collection("Collection")

    return true
}

Screen Shot 2022-09-03 at 14 28 41

Reproducing the issue

No response

Firebase SDK Version

9.5.0

Xcode Version

13.4.1

Installation Method

Swift Package Manager

Firebase Product(s)

Firestore

Targeted Platforms

iOS

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@dconeybe
Copy link
Contributor

dconeybe commented Sep 3, 2022

This is actually an issue that we (the Firestore SDK developers) just discovered today. The bug was added in 9.5.0. There is no workaround, except downgrading. The fix will almost certainly be in the next release, which is scheduled for mid-September 2022. Here is the fix: #10170.

@morganchen12 morganchen12 added this to the 9.6.0 - M121 milestone Sep 6, 2022
dconeybe added a commit to firebase/firebase-cpp-sdk that referenced this issue Sep 7, 2022
dconeybe added a commit to firebase/firebase-cpp-sdk that referenced this issue Sep 7, 2022
…irebase/firebase-ios-sdk#10168 and the firestore testapp crashes"

This fix didn't work because it conflicts with other dependencies.

This reverts commit 8310d87.
@dconeybe
Copy link
Contributor

@h-unterp
Copy link

h-unterp commented Sep 17, 2022

@dconeybe Thank you, but I am still unable to move past this bug.
have manually updated every firebase related lib to current versions, yet they still depend on 9.5.0. Done

flutter clean; rm Podfile.lock; rm -rf Pods; pod update...still seeing:

in /ios/Pods/Local Podspecs/cloud_firestore.podspec.json

"dependencies": {
    "Firebase/Firestore": [
      "9.5.0"
    ]
  },
  "static_framework": true,
  "pod_target_xcconfig": {
    "GCC_PREPROCESSOR_DEFINITIONS": "LIBRARY_VERSION=\\@\\\"3.4.8\\\" LIBRARY_NAME=\\@\\\"flutter-fire-fst\\\"",
    "DEFINES_MODULE": "YES"
  }
}

and running build seeing:

    [!] CocoaPods could not find compatible versions for pod "FirebaseFirestore":
      In Podfile:
        FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `9.6.0`)
        cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 3.4.8, which depends on
          Firebase/Firestore (= 9.5.0) was resolved to 9.5.0, which depends on
            FirebaseFirestore (~> 9.5.0)

https://github.com/firebase/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore 3.4.8 was released after 9.6.0 any idea why I am seeing this? Thank you

@dconeybe
Copy link
Contributor

Unfortunately the maintainers of this repository do not support flutterfire. This looks like flutterfire needs to update their dependency on Firebase/Firestore to 9.6.0. Please log a bug against flutterfire about this.

@h-unterp
Copy link

Thank you for the quick response

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