Skip to content

Commit d45400c

Browse files
authored
Merge branch 'main' into yp-add-fid-arg
2 parents 571d213 + 4754a2f commit d45400c

7 files changed

Lines changed: 11 additions & 13 deletions

File tree

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var buildProject = ts.createProject('tsconfig.json', { rootDir: 'src', declarati
5656

5757
// Include dom libraries during test compilation since we use some web SDK
5858
// libraries in our tests.
59-
var buildTest = ts.createProject('tsconfig.json', { lib: ['es2018', 'dom'] });
59+
var buildTest = ts.createProject('tsconfig.json', { lib: ['es2021', 'dom'] });
6060

6161
var banner = `/*! firebase-admin v${pkg.version} */\n`;
6262

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebase-admin",
3-
"version": "13.10.0",
3+
"version": "14.0.0",
44
"description": "Firebase admin SDK for Node.js",
55
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
66
"license": "Apache-2.0",

src/messaging/messaging.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,9 @@ export class Messaging {
252252
if (sessionErrors.length > 0) {
253253
// Combine the original stream error and all session errors
254254
const allErrors = [result.reason, ...sessionErrors];
255-
// TODO: AggregateError is supported in Node 18+ but only included in the ES2021+
256-
// We use (global as any).AggregateError as a workaround to access it in ES2020.
257-
const cause = new (global as any).AggregateError(allErrors, 'Stream failure and session failures occurred');
255+
const cause = new AggregateError(allErrors, 'Stream failure and session failures occurred');
258256

259-
const streamMessage = result.reason.message || 'Unknown stream error';
257+
const streamMessage = result.reason?.message || 'Unknown stream error';
260258
const sessionMessage = `. Session failures: ${sessionErrors.map(e => e.message).join(', ')}`;
261259

262260
error = new FirebaseMessagingError({

src/utils/api-request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ export class Http2SessionHandler {
13751375
this.http2Session.on('error', (error: any) => {
13761376
const codePart = error?.code ? `${error.code} - ` : '';
13771377
let errorMessage: string;
1378-
if (error?.name === 'AggregateError' && Array.isArray(error.errors)) {
1378+
if ((error instanceof AggregateError || error?.name === 'AggregateError') && Array.isArray(error.errors)) {
13791379
errorMessage = `Session error while making requests: ${codePart}${error.name}: ` +
13801380
`[${error.errors.map((e: any) => e.message).join(', ')}]`;
13811381
} else {

test/integration/postcheck/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"compilerOptions": {
33
"module": "commonjs",
44
"moduleResolution": "node",
5-
"target": "es2020",
5+
"target": "es2021",
66
"noImplicitAny": false,
7-
"lib": ["es2020"],
7+
"lib": ["es2021"],
88
"outDir": "lib",
99
"typeRoots": [
1010
"node_modules/@types"

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"target": "es2020",
4+
"target": "es2021",
55
"declaration": true,
66
"sourceMap": true,
77
"noImplicitAny": true,
@@ -13,7 +13,7 @@
1313
"strictNullChecks": true,
1414
"strictFunctionTypes": true,
1515
//"strictPropertyInitialization": true,
16-
"lib": ["es2020"],
16+
"lib": ["es2021"],
1717
"outDir": "lib",
1818
"stripInternal": true,
1919
"rootDir": "."

0 commit comments

Comments
 (0)