8000 [Auth] Fix error code thrown when the network errors out by sam-gc · Pull Request #5892 · firebase/firebase-js-sdk · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by exte 8000 nsion

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/moody-ways-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/auth": patch
---

Fix error code thrown when the network times out
2 changes: 1 addition & 1 deletion packages/auth/src/api/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ describe('api/_performApiRequest', () => {
request
);
clock.tick(DEFAULT_API_TIMEOUT_MS.get() + 1);
await expect(promise).to.be.rejectedWith(FirebaseError, 'auth/timeout');
await expect(promise).to.be.rejectedWith(FirebaseError, 'auth/network-request-failed');
clock.restore();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class NetworkTimeout<T> {
private timer: any | null = null;
readonly promise = new Promise<T>((_, reject) => {
this.timer = setTimeout(() => {
return reject(_createError(this.auth, AuthErrorCode.TIMEOUT));
return reject(_createError(this.auth, AuthErrorCode.NETWORK_REQUEST_FAILED));
}, DEFAULT_API_TIMEOUT_MS.get());
});

Expand Down
0