diff options
author | Konstantin Varlamov <var-const@users.noreply.github.com> | 2018-06-07 12:29:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 12:29:16 -0400 |
commit | 7b2aa01da3df89dbea23b7c73202c6bf3f5813d3 (patch) | |
tree | f32ffbe3dc72f242bbdfb3c3e87b9003b61b9280 /Firestore/Example/Tests/Remote/FSTDatastoreTests.mm | |
parent | 83fc5714b216fc867ac02875a3e2c6b6a013afce (diff) |
Force refresh token if RPC fails with "Unauthenticated" error (#1373)
"Unauthenticated" is presumed to mean that token is expired (which might happen if local clock is wrong) and retried, subject to the usual backoff logic.
Diffstat (limited to 'Firestore/Example/Tests/Remote/FSTDatastoreTests.mm')
-rw-r--r-- | Firestore/Example/Tests/Remote/FSTDatastoreTests.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Firestore/Example/Tests/Remote/FSTDatastoreTests.mm b/Firestore/Example/Tests/Remote/FSTDatastoreTests.mm index 6d6e912..9783e37 100644 --- a/Firestore/Example/Tests/Remote/FSTDatastoreTests.mm +++ b/Firestore/Example/Tests/Remote/FSTDatastoreTests.mm @@ -53,6 +53,12 @@ code:FIRFirestoreErrorCodeUnavailable userInfo:nil]; XCTAssertFalse([FSTDatastore isPermanentWriteError:error]); + + // "unauthenticated" is considered a recoverable error due to expired token. + error = [NSError errorWithDomain:FIRFirestoreErrorDomain + code:FIRFirestoreErrorCodeUnauthenticated + userInfo:nil]; + XCTAssertFalse([FSTDatastore isPermanentWriteError:error]); } @end |