Skip to content

Commit

Permalink
Merge branch 'master' into mila/BloomFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
milaGGL committed Feb 16, 2023
2 parents 839ccf7 + c8a6e08 commit b7072d1
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 35 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-taxis-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/auth': patch
---

Modify \_fail to use AuthErrorCode.INTERNAL_ERROR and pass in error message.
2 changes: 1 addition & 1 deletion config/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Cloud Functions for Firebase",
"dependencies": {
"cors": "2.8.5",
"firebase-admin": "11.3.0",
"firebase-admin": "11.5.0",
"firebase-functions": "3.24.1"
},
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/demo/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "11.3.0",
"firebase-admin": "11.5.0",
"firebase-functions": "3.24.1"
},
"private": true
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"rollup": "2.79.1",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"selenium-webdriver": "4.5.0",
"selenium-webdriver": "4.8.0",
"typescript": "4.7.4"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/demo/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "11.3.0",
"firebase-admin": "11.5.0",
"firebase-functions": "3.24.1"
},
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"rollup": "2.79.1",
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-typescript2": "0.31.2",
"selenium-webdriver": "4.5.0",
"selenium-webdriver": "4.8.0",
"typescript": "4.7.4",
"@types/express": "4.17.14"
},
Expand Down
38 changes: 20 additions & 18 deletions packages/auth/src/api/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,26 @@ describe('api/_performApiRequest', () => {
});
});

context('with non-Firebase Errors', () => {
afterEach(mockFetch.tearDown);

it('should handle non-FirebaseErrors', async () => {
mockFetch.setUpWithOverride(() => {
return new Promise<never>((_, reject) => reject(new Error('error')));
});
const promise = _performApiRequest<typeof request, never>(
auth,
HttpMethod.POST,
Endpoint.SIGN_UP,
request
);
await expect(promise).to.be.rejectedWith(
FirebaseError,
'auth/internal-error'
);
});
});

context('with network issues', () => {
afterEach(mockFetch.tearDown);

Expand Down Expand Up @@ -345,24 +365,6 @@ describe('api/_performApiRequest', () => {
expect(clock.clearTimeout).to.have.been.called;
clock.restore();
});

it('should handle network failure', async () => {
mockFetch.setUpWithOverride(() => {
return new Promise<never>((_, reject) =>
reject(new Error('network error'))
);
});
const promise = _performApiRequest<typeof request, never>(
auth,
HttpMethod.POST,
Endpoint.SIGN_UP,
request
);
await expect(promise).to.be.rejectedWith(
FirebaseError,
'auth/network-request-failed'
);
});
});

context('edgcase error mapping', () => {
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 @@ -181,7 +181,7 @@ export async function _performFetchWithErrorHandling<V>(
if (e instanceof FirebaseError) {
throw e;
}
_fail(auth, AuthErrorCode.NETWORK_REQUEST_FAILED);
_fail(auth, AuthErrorCode.INTERNAL_ERROR, { 'message': String(e) });
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"outDir": "dist"
},
"exclude": [
"dist/**/*"
"**/dist/**/*"
]
}
2 changes: 1 addition & 1 deletion packages/rules-unit-testing/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"private": true,
"dependencies": {
"firebase-admin": "11.3.0",
"firebase-admin": "11.5.0",
"firebase-functions": "3.24.1"
},
"engines": {
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15380,14 +15380,14 @@ selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1:
tmp "0.0.30"
xml2js "^0.4.17"

selenium-webdriver@4.5.0:
version "4.5.0"
resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.5.0.tgz#7e20d0fc038177970dad81159950c12f7411ac0d"
integrity sha512-9mSFii+lRwcnT2KUAB1kqvx6+mMiiQHH60Y0VUtr3kxxi3oZ3CV3B8e2nuJ7T4SPb+Q6VA0swswe7rYpez07Bg==
selenium-webdriver@4.8.0:
version "4.8.0"
resolved "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.8.0.tgz#386d57f23fe8edf5178f5bd06aae9ffaffbcb692"
integrity sha512-s/HL8WNwy1ggHR244+tAhjhyKMJnZLt1HKJ6Gn7nQgVjB/ybDF+46Uui0qI2J7AjPNJzlUmTncdC/jg/kKkn0A==
dependencies:
jszip "^3.10.0"
tmp "^0.2.1"
ws ">=8.7.0"
ws ">=8.11.0"

selenium-webdriver@^4.0.0-alpha.7:
version "4.0.0-rc-1"
Expand Down Expand Up @@ -18108,10 +18108,10 @@ ws@>=7.4.6:
resolved "https://registry.npmjs.org/ws/-/ws-8.2.2.tgz#ca684330c6dd6076a737250ed81ac1606cb0a63e"
integrity sha512-Q6B6H2oc8QY3llc3cB8kVmQ6pnJWVQbP7Q5algTcIxx7YEpc0oU4NBVHlztA7Ekzfhw2r0rPducMUiCGWKQRzw==

ws@>=8.7.0:
version "8.9.0"
resolved "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz#2a994bb67144be1b53fe2d23c53c028adeb7f45e"
integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==
ws@>=8.11.0:
version "8.12.0"
resolved "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz#485074cc392689da78e1828a9ff23585e06cddd8"
integrity sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==

ws@^7.2.3:
version "7.5.5"
Expand Down

0 comments on commit b7072d1

Please sign in to comment.