cachapa / firedart

A dart-native implementation of the Firebase Auth and Firestore SDKs
https://pub.dev/packages/firedart
Apache License 2.0
174 stars 62 forks source link

Stream termination gRPC error #99

Closed Kolis121 closed 7 months ago

Kolis121 commented 1 year ago

Do we have a solution for the streaming termination on Desktop app? Currently StreamBuilder will be disconnected randomly giving the following error crashing the whole application:

flutter: Handling error gRPC Error (code: 16, codeName: UNAUTHENTICATED, message: Missing or invalid authentication., details: [], rawResponse: null, trailers: {content-disposition: attachment}) using FirestoreGateway._handleError

cachapa commented 1 year ago

I believe this happens due to the access token expiring.

If that's the case, a workaround would be to catch that exception and reopen the stream (which should trigger a token refresh).

The fix would be to find a way to refresh the token using the gRPC API without having to terminate the connection. Contributions here would be welcome :-)

cachapa commented 7 months ago

Closed by #130