Skip to content

Commit b7072d1

Browse files
committed
Merge branch 'master' into mila/BloomFilter
2 parents 839ccf7 + c8a6e08 commit b7072d1

File tree

11 files changed

+42
-35
lines changed

11 files changed

+42
-35
lines changed

.changeset/tough-taxis-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/auth': patch
3+
---
4+
5+
Modify \_fail to use AuthErrorCode.INTERNAL_ERROR and pass in error message.

config/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Cloud Functions for Firebase",
44
"dependencies": {
55
"cors": "2.8.5",
6-
"firebase-admin": "11.3.0",
6+
"firebase-admin": "11.5.0",
77
"firebase-functions": "3.24.1"
88
},
99
"private": true,

packages/auth-compat/demo/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"logs": "firebase functions:log"
1010
},
1111
"dependencies": {
12-
"firebase-admin": "11.3.0",
12+
"firebase-admin": "11.5.0",
1313
"firebase-functions": "3.24.1"
1414
},
1515
"private": true

packages/auth-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"rollup": "2.79.1",
6565
"rollup-plugin-replace": "2.2.0",
6666
"rollup-plugin-typescript2": "0.31.2",
67-
"selenium-webdriver": "4.5.0",
67+
"selenium-webdriver": "4.8.0",
6868
"typescript": "4.7.4"
6969
},
7070
"repository": {

packages/auth/demo/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"logs": "firebase functions:log"
1010
},
1111
"dependencies": {
12-
"firebase-admin": "11.3.0",
12+
"firebase-admin": "11.5.0",
1313
"firebase-functions": "3.24.1"
1414
},
1515
"private": true,

packages/auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"rollup": "2.79.1",
126126
"rollup-plugin-sourcemaps": "0.6.3",
127127
"rollup-plugin-typescript2": "0.31.2",
128-
"selenium-webdriver": "4.5.0",
128+
"selenium-webdriver": "4.8.0",
129129
"typescript": "4.7.4",
130130
"@types/express": "4.17.14"
131131
},

packages/auth/src/api/index.test.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,26 @@ describe('api/_performApiRequest', () => {
308308
});
309309
});
310310

311+
context('with non-Firebase Errors', () => {
312+
afterEach(mockFetch.tearDown);
313+
314+
it('should handle non-FirebaseErrors', async () => {
315+
mockFetch.setUpWithOverride(() => {
316+
return new Promise<never>((_, reject) => reject(new Error('error')));
317+
});
318+
const promise = _performApiRequest<typeof request, never>(
319+
auth,
320+
HttpMethod.POST,
321+
Endpoint.SIGN_UP,
322+
request
323+
);
324+
await expect(promise).to.be.rejectedWith(
325+
FirebaseError,
326+
'auth/internal-error'
327+
);
328+
});
329+
});
330+
311331
context('with network issues', () => {
312332
afterEach(mockFetch.tearDown);
313333

@@ -345,24 +365,6 @@ describe('api/_performApiRequest', () => {
345365
expect(clock.clearTimeout).to.have.been.called;
346366
clock.restore();
347367
});
348-
349-
it('should handle network failure', async () => {
350-
mockFetch.setUpWithOverride(() => {
351-
return new Promise<never>((_, reject) =>
352-
reject(new Error('network error'))
353-
);
354-
});
355-
const promise = _performApiRequest<typeof request, never>(
356-
auth,
357-
HttpMethod.POST,
358-
Endpoint.SIGN_UP,
359-
request
360-
);
361-
await expect(promise).to.be.rejectedWith(
362-
FirebaseError,
363-
'auth/network-request-failed'
364-
);
365-
});
366368
});
367369

368370
context('edgcase error mapping', () => {

packages/auth/src/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export async function _performFetchWithErrorHandling<V>(
181181
if (e instanceof FirebaseError) {
182182
throw e;
183183
}
184-
_fail(auth, AuthErrorCode.NETWORK_REQUEST_FAILED);
184+
_fail(auth, AuthErrorCode.INTERNAL_ERROR, { 'message': String(e) });
185185
}
186186
}
187187

packages/firebase/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"outDir": "dist"
55
},
66
"exclude": [
7-
"dist/**/*"
7+
"**/dist/**/*"
88
]
99
}

packages/rules-unit-testing/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"private": true,
1010
"dependencies": {
11-
"firebase-admin": "11.3.0",
11+
"firebase-admin": "11.5.0",
1212
"firebase-functions": "3.24.1"
1313
},
1414
"engines": {

0 commit comments

Comments
 (0)