google-cloud-dotnet: FirestoreChangeListener won't receive updates after 1 hour
I have been facing an issue with the real time capabilities of Firestore API. I was reading Firestore documentation when I found out that user authentication tokens expire in 1 hour. This led me to the question: If the token expires in 1 hour, what happens to FirestoreChangeListener after expiration?
I then proceeded to run a simple test to find out. It turns out that FirestoreChangeListener does stop receiving updates after 1 hour. This is the test output:
9/26/2018 8:43:30 AM: Listener started
9/26/2018 8:43:30 AM: Document has changed
9/26/2018 8:43:36 AM: Document has changed // Document actually updated
9/26/2018 8:53:30 AM: Document has changed
9/26/2018 9:03:30 AM: Document has changed
9/26/2018 9:13:30 AM: Document has changed
9/26/2018 9:23:30 AM: Document has changed
9/26/2018 9:33:30 AM: Document has changed
9/26/2018 9:39:45 AM: Document has changed // Document actually updated
9/26/2018 9:40:00 AM: Document has changed // Document actually updated
9/26/2018 9:43:30 AM: Document has changed
// Document updated many times for the next 30 minutes
// No more updates received
As you can see, after precisely 1 hour, updates are no longer received. It is important to point that I am authenticated with an user account, not a service account. I haven’t tested this behavior using a service account.
It is interesting how FirestoreChangeListener receives an update every 10 minutes even when the document was not changed. That is probably because Firestore resets the stream every 10 minutes. I am wondering if these extra updates are billed.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15
Hooray. Given that we’ve learned a lot more, I’m going to close this issue so that we can keep track of it in #2542 without confusion.
Thanks for all your efforts tracking things down!