Skip to content

[cloud_firestore] Snapshot lost attributes changes after offline updates #3621

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

Closed
lukber opened this issue Apr 6, 2022 · 2 comments · Fixed by #3623
Closed

[cloud_firestore] Snapshot lost attributes changes after offline updates #3621

lukber opened this issue Apr 6, 2022 · 2 comments · Fixed by #3623
Assignees

Comments

@lukber
Copy link

lukber commented Apr 6, 2022

Android Studio version: 2020.3.1. Patch 3
Firebase Component: Firestore
Component version: firebase-bom: 29.3.0

Describe the problem

When is Android client offline and I update property X and next update property Y then property X lost changes.

Steps to reproduce:

  1. My phone is online
  2. I create new movie document. DocumentSnapshot.getData() contain all document data (Snapshot: {name=Star wars (episode 0), stars=0, likes=0}, ID: 1mlmdMqsvrB9AucwuVvq)
  3. Switch phone to flight mode
  4. I update likes to 1. DocumentSnapshot.getData() contain all document data (Snapshot: {name=Star wars (episode 0), stars=0, likes=1}, ID: 1mlmdMqsvrB9AucwuVvq)
  5. I update stars to 1. DocumentSnapshot.getData() contain all document data (Snapshot: {name=Star wars (episode 0), stars=1, likes=1}, ID: 1mlmdMqsvrB9AucwuVvq)
  6. I update stars to 2. DocumentSnapshot.getData() lost changes in likes attribute (Snapshot: {name=Star wars (episode 0), stars=2, likes=0}, ID: 1mlmdMqsvrB9AucwuVvq)

Relevant Code:

Here is a test application. You must put google-services.json yourself.

  1. Start app with internet connection
  2. Click to ADD NEW MOVIE button
  3. Switch phone to flight mode
  4. Click to LIKES button
  5. Click to STARS button
  6. Click to STARS button
@lukber
Copy link
Author

lukber commented Apr 6, 2022

I add console log: logcat.txt

@lukber
Copy link
Author

lukber commented May 6, 2022

Hi, the fix has already been moved to the master branch, but a new version has not yet been released. When do you plan to release a new version?

@firebase firebase locked and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants