1

I am using Firestore in the browser with offline mode.

How can I check, if there are any updates applied on my client but not yet transacted on the server?

I would like to check this, without knowing the specific documents. I want to know if there are such updates to ANY documents.

1
  • 1
    I'm wondering if you can do something with waitForPendingWrites. Like: if the task you get from that immediately is completed, there were apparently not pending writes? Commented Nov 4, 2024 at 22:26

2 Answers 2

2

None of the Firestore SDKs on any platform offer an API for this. If this is something you require, you'll have to build your own application component that somehow keeps track of all writes to completion and persists that between app launches.

You're not the first person to ask this, and it's worth writing a feature request for this publicly or privately.

Sign up to request clarification or add additional context in comments.

Comments

0

Call waitForPendingUpdates() and wait for the resulting promise.

https://firebase.google.com/docs/reference/js/firestore_.md#waitforpendingwrites_231a8e0

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.