firebase-kotlin-sdk icon indicating copy to clipboard operation
firebase-kotlin-sdk copied to clipboard

JS Realtime Database truncates children

Open thejoeba opened this issue 4 years ago • 6 comments
trafficstars

When using the project in JS, I try to collect the values for an object, but the children count is always 1. The same code on Android returns more than 1.

Firebase.database.reference("rooms").valueEvents.collect { querySnapshot ->
    console.log("rooms: ${querySnapshot.children.count()}")
}

using: firebase-database:1.4.3

thejoeba avatar Oct 11 '21 19:10 thejoeba

are you able to add a failing test for this in a PR? I suspect this is not an issue with the firebase-kotlin-sdk but perhaps the firebase-js-sdk

nbransby avatar Oct 13 '21 21:10 nbransby

Sure, I don't see any unit tests for database jsMain. I'll look for other js tests, but what database would I point to in the PR?

thejoeba avatar Oct 14 '21 00:10 thejoeba

You can write the tests in commonTest using the same style as the firestore tests, there is a test project already setup, let me know what test data you need in the db and I can add it

nbransby avatar Oct 14 '21 02:10 nbransby

I haven't contributed to an open source project before so I may have done this wrong, but I could not create a branch: remote: Permission to GitLiveApp/firebase-kotlin-sdk.git denied to thejoeba.

I have attached my commit to a patch in this comment. I was not able to run the firestore test or this new test I wrote. Issue-236-patch.zip

thejoeba avatar Oct 14 '21 18:10 thejoeba

You need to fork the repository and then push the branch to your fork then you can create a pull request to this repo

nbransby avatar Oct 14 '21 18:10 nbransby

Thanks. I have done this.

thejoeba avatar Oct 14 '21 19:10 thejoeba

@thejoeba @nbransby I faced the same problem, is there any solution?

Darkos-den avatar Feb 04 '23 19:02 Darkos-den