Skip to content

Firestore onSnapshot() or get() stucked on app restart - same as 5058 #5724

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
L1b3rtyy opened this issue Nov 11, 2021 · 7 comments
Closed
Assignees

Comments

@L1b3rtyy
Copy link

Same as #5058

I am creating a new issue as 5058 is locked.

My setup has slightly evolved but the issue is exactly the same:
Operating System version: _____ iOS 15.0
Browser version: _____ Safari 15.0
Firebase SDK version: _____ 9.2.0
Firebase Product: _____ Firestore, using the compat version

After restarting my app, a call to get() or onSnapshot() will never return a document that I know exist. Killing the app and starting from scratch will work.

The problem only occurs on iOS, all the other platforms I have tried work as expected:

  • Windows 10 - Firefox, Chrome, Edge
  • Ubuntu - Chrome, Opera
  • Mac - Safari
  • Android - Chrome

And here are the logs I have now:

LOG - [2021-11-11T18:17:48.490Z] @firebase/firestore:Firestore (9.2.0): SimpleDb|Opening database:firestore/[DEFAULT]/fireauthentest/main
LOG - [2021-11-11T18:17:48.489Z] @firebase/firestore:Firestore (9.2.0): IndexedDbPersistence|Starting transaction:updateClientMetadataAndTryBecomePrimary
LOG - [2021-11-11T18:17:48.480Z] @firebase/firestore:Firestore (9.2.0): FirestoreClient|Initializing OfflineComponentProvider
LOG - [2021-11-11T18:17:48.441Z] @firebase/firestore:Firestore (9.2.0): FirestoreClient|Received user=ZZNtKb3byiQsrHZ4I4A3IyfDZWL2

Fyi, I can now reproduce the issue on my app (but not on a mini repo unfortunately) so I can try to pull more info or logs for you if you tell me how to get them

@google-oss-bot
Copy link
Contributor

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

@ehsannas
Copy link
Contributor

Hi @olivierkrener , Thanks for reporting.

Are you seeing this issue only when using Safari 15 on iOS? There was an issue specific to Safari 15 that just got fixed (#5716).

@L1b3rtyy
Copy link
Author

Yes I am using Sarai 15 on iOS but note that #5058 was on Safari 14.4.2 and was showing exactly the same issue. In what release will #5716 be merged so I can test it?

@ehsannas
Copy link
Contributor

This particular issue also existed in Safari 14 (#4076). It is a bug in Safari; we placed a workaround for Safari 14 in late July, and we added the same workaround for Safari 15 a couple of days ago. #5716 should be picked up by the next release.

@L1b3rtyy
Copy link
Author

L1b3rtyy commented Nov 12, 2021

This sounds great. I will be monitoring the release notes.

I see in the comments of #4076 that calling firestore.terminate() before reloading the app seems to solve the issue. Is it worth me trying?

@ehsannas
Copy link
Contributor

I think it's worth trying to see if this workaround works for you while you wait for the next release.

@L1b3rtyy
Copy link
Author

I can confirm that this workaround works on my two test iOS devices (running on Safari 12 and 15)

@wu-hui wu-hui closed this as completed Nov 23, 2021
@firebase firebase locked and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants