Skip to content

Commit 628b6ad

Browse files
authored
Merge branch 'master' into ch-heartbeat
2 parents 5bb0fe0 + 4605d4b commit 628b6ad

File tree

359 files changed

+24338
-6369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+24338
-6369
lines changed

.changeset/curvy-brooms-clean.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+
Fix bug where `user.providerData` field was being improperly initialized

.github/CODEOWNERS

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
# These owners will be the default owners for everything in the repo.
36-
* @Feiyang1 @hiranya911 @hsubox76 @firebase/jssdk-global-approvers
36+
* @allspain @hsubox76 @firebase/jssdk-global-approvers
3737

3838
# Database Code
3939
packages/database @schmidt-sebastian @jsdt @firebase/jssdk-global-approvers
@@ -79,20 +79,20 @@ packages/performance-compat @jposuna @firebase/jssdk-global-approvers
7979
packages/performance-types @jposuna @firebase/jssdk-global-approvers
8080

8181
# Analytics Code
82-
packages/analytics @hsubox76 @Feiyang1 @firebase/jssdk-global-approvers
83-
packages/analytics-compat @hsubox76 @Feiyang1 @firebase/jssdk-global-approvers
84-
packages/analytics-types @hsubox76 @Feiyang1 @firebase/jssdk-global-approvers
82+
packages/analytics @hsubox76 @firebase/jssdk-global-approvers
83+
packages/analytics-compat @hsubox76 @firebase/jssdk-global-approvers
84+
packages/analytics-types @hsubox76 @firebase/jssdk-global-approvers
8585

8686
# Remote Config Code
8787
packages/remote-config @erikeldridge @firebase/jssdk-global-approvers
8888
packages/remote-config-compat @erikeldridge @firebase/jssdk-global-approvers
8989
packages/remote-config-types @erikeldridge @firebase/jssdk-global-approvers
9090

9191
# App Check Code
92-
packages/app-check @hsubox76 @Feiyang1 @firebase/jssdk-global-approvers
93-
packages/app-check-compat @hsubox76 @Feiyang1 @firebase/jssdk-global-approvers
94-
packages/app-check-types @hsubox76 @Feiyang1 @firebase/jssdk-global-approvers
95-
packages/app-check-interop-types @hsubox76 @Feiyang1 @firebase/jssdk-global-approvers
92+
packages/app-check @hsubox76 @firebase/jssdk-global-approvers
93+
packages/app-check-compat @hsubox76 @firebase/jssdk-global-approvers
94+
packages/app-check-types @hsubox76 @firebase/jssdk-global-approvers
95+
packages/app-check-interop-types @hsubox76 @firebase/jssdk-global-approvers
9696

9797
# Documentation Changes
9898
packages/firebase/index.d.ts @egilmorez @firebase/jssdk-global-approvers

.github/workflows/e2e-test.yml

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -19,57 +19,59 @@ jobs:
1919
working-directory: './e2e'
2020

2121
steps:
22-
- name: Checkout Repo
23-
uses: actions/checkout@master
24-
- name: Set up Node (12)
25-
uses: actions/setup-node@v2
26-
with:
27-
node-version: 12.x
28-
- name: install Chrome stable
29-
run: |
30-
sudo apt-get update
31-
sudo apt-get install google-chrome-stable
32-
- name: Bump Node memory limit
33-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
34-
- name: Write project config
35-
env:
36-
PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }}
37-
TEST_ACCOUNT: ${{ secrets.TEST_ACCOUNT }}
38-
run: |
39-
echo "export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT" > firebase-config.js
40-
- name: Yarn install
41-
run: |
42-
echo "Installing firebase@${{ github.event.inputs.versionOrTag }}"
43-
yarn add firebase@${{ github.event.inputs.versionOrTag }}
44-
yarn
45-
- name: Deploy "callTest" cloud function
46-
run: |
47-
pushd functions
48-
npm install
49-
popd
50-
npx firebase-tools deploy --only functions:callTest --project jscore-sandbox-141b5 --token $FIREBASE_CLI_TOKEN
51-
working-directory: ./config
52-
env:
53-
FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
54-
- name: Run modular tests
55-
env:
56-
APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }}
57-
run: xvfb-run yarn test:modular
58-
- name: Run compat tests
59-
env:
60-
APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }}
61-
run: xvfb-run yarn test:compat
62-
- name: Tests succeeded
63-
if: success()
64-
run: node scripts/ci/notify-test-result.js success
65-
env:
66-
WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }}
67-
# run in root
68-
working-directory: '.'
69-
- name: Tests failed
70-
if: failure()
71-
run: node scripts/ci/notify-test-result.js fail
72-
env:
73-
WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }}
74-
# run in root
75-
working-directory: '.'
22+
- name: Checkout Repo
23+
uses: actions/checkout@master
24+
- name: Set up Node (12)
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: 12.x
28+
- name: install Chrome stable
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install google-chrome-stable
32+
- name: Bump Node memory limit
33+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
34+
- name: Write project config
35+
env:
36+
PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }}
37+
TEST_ACCOUNT: ${{ secrets.TEST_ACCOUNT }}
38+
run: |
39+
echo "export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT" > firebase-config.js
40+
- name: Yarn install
41+
run: |
42+
echo "Installing firebase@${{ github.event.inputs.versionOrTag }}"
43+
yarn add firebase@${{ github.event.inputs.versionOrTag }}
44+
yarn
45+
- name: Deploy "callTest" cloud function
46+
run: |
47+
pushd functions
48+
npm install
49+
popd
50+
npx firebase-tools deploy --only functions:callTest --project jscore-sandbox-141b5 --token $FIREBASE_CLI_TOKEN
51+
working-directory: ./config
52+
env:
53+
FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
54+
- name: Run modular tests
55+
env:
56+
APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }}
57+
run: xvfb-run yarn test:modular
58+
- name: Run compat tests
59+
env:
60+
APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }}
61+
run: xvfb-run yarn test:compat
62+
- name: Tests succeeded
63+
if: success()
64+
run: node scripts/ci/notify-test-result.js success
65+
env:
66+
WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }}
67+
RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }}
68+
# run in root
69+
working-directory: '.'
70+
- name: Tests failed
71+
if: failure()
72+
run: node scripts/ci/notify-test-result.js fail
73+
env:
74+
WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }}
75+
RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }}
76+
# run in root
77+
working-directory: '.'

.github/workflows/health-metrics-test.yml renamed to .github/workflows/health-metrics-pull-request.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ name: Health Metrics
33
on: [push, pull_request]
44

55
env:
6-
METRICS_SERVICE_URL: ${{ secrets.METRICS_SERVICE_URL }}
76
GITHUB_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
7+
# TODO(yifany): parse from git commit history directly
8+
# Reason: actions/checkout@v2 does not always honor ${{ github.event.pull_request.base.sha }},
9+
# therefore "base.sha" sometimes is not the commit that actually gets merged with the
10+
# pull request head commit for CI test.
11+
# See:
12+
# - https://github.com/actions/checkout/issues/27
13+
# - https://github.com/actions/checkout/issues/237
814
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
915
NODE_OPTIONS: "--max-old-space-size=4096"
1016

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Health Metrics
2+
3+
on:
4+
push:
5+
tags: ['**']
6+
7+
jobs:
8+
release-diffing:
9+
name: Release Diffing
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: google-github-actions/setup-gcloud@master
13+
with:
14+
service_account_key: ${{ secrets.GCP_SA_KEY }}
15+
- uses: FirebaseExtended/github-actions/health-metrics/release-diffing@master
16+
with:
17+
repo: ${{ github.repository }}
18+
ref: ${{ github.ref }}
19+
commit: ${{ github.sha }}

.github/workflows/release-log.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ jobs:
2020
node-version: 14.x
2121

2222
- name: Get PR number and send to tracker.
23-
run: node scripts/ci/log-changesets.js
23+
run: node scripts/ci/log-changesets.js
24+
env:
25+
RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }}

.vscode/launch.json

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,12 @@
2929
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
3030
"cwd": "${workspaceRoot}/packages/firestore",
3131
"args": [
32-
"--require", "ts-node/register/type-check",
32+
"--require", "babel-register.js",
3333
"--require", "index.node.ts",
3434
"--timeout", "5000",
3535
"test/{,!(browser|integration)/**/}*.test.ts",
3636
"--exit"
3737
],
38-
"env": {
39-
"TS_NODE_CACHE": "NO",
40-
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}"
41-
},
4238
"sourceMaps": true,
4339
"protocol": "inspector"
4440
},
@@ -49,17 +45,15 @@
4945
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
5046
"cwd": "${workspaceRoot}/packages/firestore",
5147
"args": [
52-
"--require", "ts-node/register/type-check",
48+
"--require", "babel-register.js",
5349
"--require", "index.node.ts",
5450
"--require", "test/util/node_persistence.ts",
5551
"--timeout", "5000",
5652
"test/{,!(browser|integration)/**/}*.test.ts",
5753
"--exit"
5854
],
5955
"env": {
60-
"USE_MOCK_PERSISTENCE": "YES",
61-
"TS_NODE_CACHE": "NO",
62-
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}"
56+
"USE_MOCK_PERSISTENCE": "YES"
6357
},
6458
"sourceMaps": true,
6559
"protocol": "inspector"
@@ -71,15 +65,13 @@
7165
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
7266
"cwd": "${workspaceRoot}/packages/firestore",
7367
"args": [
74-
"--require", "ts-node/register/type-check",
68+
"--require", "babel-register.js",
7569
"--require", "index.node.ts",
7670
"--timeout", "5000",
7771
"test/{,!(browser|unit)/**/}*.test.ts",
7872
"--exit"
7973
],
8074
"env": {
81-
"TS_NODE_CACHE": "NO",
82-
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}",
8375
"FIRESTORE_EMULATOR_PORT" : "8080",
8476
"FIRESTORE_EMULATOR_PROJECT_ID" : "test-emulator"
8577
},
@@ -93,7 +85,7 @@
9385
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
9486
"cwd": "${workspaceRoot}/packages/firestore",
9587
"args": [
96-
"--require", "ts-node/register/type-check",
88+
"--require", "babel-register.js",
9789
"--require", "index.node.ts",
9890
"--require", "test/util/node_persistence.ts",
9991
"--timeout", "5000",
@@ -102,8 +94,6 @@
10294
],
10395
"env": {
10496
"USE_MOCK_PERSISTENCE": "YES",
105-
"TS_NODE_CACHE": "NO",
106-
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}",
10797
"FIRESTORE_EMULATOR_PORT" : "8080",
10898
"FIRESTORE_EMULATOR_PROJECT_ID" : "test-emulator"
10999
},

common/api-review/auth.api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,11 @@ export class PhoneMultiFactorGenerator {
601601
static FACTOR_ID: string;
602602
}
603603

604+
// @public
605+
export interface PhoneMultiFactorInfo extends MultiFactorInfo {
606+
readonly phoneNumber: string;
607+
}
608+
604609
// @public
605610
export interface PhoneMultiFactorSignInInfoOptions {
606611
multiFactorHint?: MultiFactorInfo;

common/api-review/firestore-lite.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import { EmulatorMockTokenOptions } from '@firebase/util';
88
import { FirebaseApp } from '@firebase/app';
9+
import { FirebaseError } from '@firebase/util';
910
import { LogLevelString as LogLevel } from '@firebase/logger';
1011

1112
// @public
@@ -147,10 +148,9 @@ export interface FirestoreDataConverter<T> {
147148
}
148149

149150
// @public
150-
export class FirestoreError extends Error {
151+
export class FirestoreError extends FirebaseError {
151152
readonly code: FirestoreErrorCode;
152153
readonly message: string;
153-
readonly name: string;
154154
readonly stack?: string;
155155
}
156156

common/api-review/firestore.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import { EmulatorMockTokenOptions } from '@firebase/util';
88
import { FirebaseApp } from '@firebase/app';
9+
import { FirebaseError } from '@firebase/util';
910
import { LogLevelString as LogLevel } from '@firebase/logger';
1011

1112
// @public
@@ -177,10 +178,9 @@ export interface FirestoreDataConverter<T> {
177178
}
178179

179180
// @public
180-
export class FirestoreError extends Error {
181+
export class FirestoreError extends FirebaseError {
181182
readonly code: FirestoreErrorCode;
182183
readonly message: string;
183-
readonly name: string;
184184
readonly stack?: string;
185185
}
186186

common/api-review/storage.api.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,15 @@ export class _FirebaseStorageImpl implements FirebaseStorage {
7777
_getAuthToken(): Promise<string | null>;
7878
get host(): string;
7979
set host(host: string);
80+
// Warning: (ae-forgotten-export) The symbol "ConnectionType" needs to be exported by the entry point index.d.ts
8081
// Warning: (ae-forgotten-export) The symbol "RequestInfo" needs to be exported by the entry point index.d.ts
8182
// Warning: (ae-forgotten-export) The symbol "Connection" needs to be exported by the entry point index.d.ts
8283
// Warning: (ae-forgotten-export) The symbol "Request" needs to be exported by the entry point index.d.ts
8384
//
8485
// (undocumented)
85-
_makeRequest<T>(requestInfo: RequestInfo_2<T>, requestFactory: () => Connection, authToken: string | null, appCheckToken: string | null): Request_2<T>;
86+
_makeRequest<I extends ConnectionType, O>(requestInfo: RequestInfo_2<I, O>, requestFactory: () => Connection<I>, authToken: string | null, appCheckToken: string | null): Request_2<O>;
8687
// (undocumented)
87-
makeRequestWithTokens<T>(requestInfo: RequestInfo_2<T>, requestFactory: () => Connection): Promise<T>;
88+
makeRequestWithTokens<I extends ConnectionType, O>(requestInfo: RequestInfo_2<I, O>, requestFactory: () => Connection<I>): Promise<O>;
8889
_makeStorageReference(loc: _Location): _Reference;
8990
get maxOperationRetryTime(): number;
9091
set maxOperationRetryTime(time: number);
@@ -112,6 +113,12 @@ export interface FullMetadata extends UploadMetadata {
112113
updated: string;
113114
}
114115

116+
// @public
117+
export function getBlob(ref: StorageReference, maxDownloadSizeBytes?: number): Promise<Blob>;
118+
119+
// @public
120+
export function getBytes(ref: StorageReference, maxDownloadSizeBytes?: number): Promise<ArrayBuffer>;
121+
115122
// @internal (undocumented)
116123
export function _getChild(ref: StorageReference, childPath: string): _Reference;
117124

@@ -124,6 +131,9 @@ export function getMetadata(ref: StorageReference): Promise<FullMetadata>;
124131
// @public
125132
export function getStorage(app?: FirebaseApp, bucketUrl?: string): FirebaseStorage;
126133

134+
// @public
135+
export function getStream(ref: StorageReference, maxDownloadSizeBytes?: number): NodeJS.ReadableStream;
136+
127137
// Warning: (ae-forgotten-export) The symbol "StorageError" needs to be exported by the entry point index.d.ts
128138
//
129139
// @internal (undocumented)

config/mocharc.node.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,9 @@ if (process.env.CI) {
3434
config.reporter = 'min';
3535
}
3636

37+
// Firestore uses babel to compile tests in Nodejs
38+
if (process.env.NO_TS_NODE) {
39+
delete config.require;
40+
}
41+
3742
module.exports = config;

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
"typescript": "4.3.4",
3636
"webpack": "5.41.1",
3737
"webpack-cli": "4.7.2",
38-
"webpack-dev-server": "3.10.1"
38+
"webpack-dev-server": "4.7.3"
3939
}
4040
}

0 commit comments

Comments
 (0)