QuerySnapshot was optimized out firebase

Viewed 36

I have the below code:

try {
    emit(Response.Loading)
    val tests = test.get().await()
    for (testing in tests.documents) {

I'm trying to fetch a bunch of documents from my test collections in Cloud Firestore. now, the test collections looks like so for example:

document 1 -> test1
document 2 -> test2
document 3 -> test3

Now, I have multiple users that I'm testing my app with. user A, val tests = test.get().await().documents returns to me all the documents above. user B, however, I get a msg in my android studio console saying that when it reaches this for (testing in tests.documents), the line above it val tests = test.get().await() it says that tests was optimized out. not sure what that means. and when looking at my app, user B only gets document 1, it doesn't get any of the other documents. Any insight?

1 Answers

It looks like this is a known bug relating to debugging coroutines (and has nothing to do with the Firebase SDKs specifically). You can read a lot about it here:

https://youtrack.jetbrains.com/issue/KT-48678

And it looks like also it's scheduled to be fixed in Kotlin 1.8.

Related