Skip to content

Commit e58f70b

Browse files
committed
Merge remote-tracking branch 'origin/master' into AutoDetectLongPollingEnabledByDefault
2 parents f166d1d + 92e2279 commit e58f70b

File tree

120 files changed

+946
-518
lines changed

Some content is hidden

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

120 files changed

+946
-518
lines changed

.changeset/dry-cats-lick.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/funny-ways-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/app': patch
3+
---
4+
5+
Make the error more helpful when `getApp()` is called before `initializeApp()`.

.changeset/grumpy-bees-shake.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/olive-cycles-count.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/silent-islands-fix.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/sixty-dolls-report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/app': patch
3+
---
4+
5+
Catch more heartbeat read/write errors.

.changeset/strong-ghosts-compare.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/swift-eels-change.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/wicked-tomatoes-smoke.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/witty-wasps-play.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/firestore': minor
3+
'firebase': minor
4+
---
5+
6+
Added the ability to configure the long-polling hanging get request timeout using the new `idleHttpRequestTimeoutSeconds` setting

.github/CODEOWNERS

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,13 @@
77
#
88
#######################################################################################################
99

10-
# ===========================================================
11-
# @firebase/jssdk-global-approvers
12-
# ===========================================================
13-
# Used for approving minor changes, large-scale refactorings, and emergency situations.
14-
# (secret team to avoid review requests)
15-
#
16-
# - @lahirumaramba
17-
# - @hsubox76
18-
# - @allspain
19-
# - @dwyfrequency
20-
21-
22-
# ===========================================================
23-
# @firebase/firestore-js-team
24-
# ===========================================================
25-
# Used for approving firestore changes.
26-
# (secret team to avoid review requests)
27-
#
28-
# - @schmidt-sebastian
29-
# - @thebrianchen
30-
# - @wu-hui
31-
# - @ehsannas
32-
# - @dconeybe
33-
34-
3510
# These owners will be the default owners for everything in the repo.
3611
* @dwyfrequency @hsubox76 @firebase/jssdk-global-approvers
3712

3813
# Database Code
39-
packages/database @maneesht @jsdt @IanWyszynski @firebase/jssdk-global-approvers
40-
packages/database-compat @maneesht @jsdt @IanWyszynski @firebase/jssdk-global-approvers
41-
packages/database-types @maneesht @jsdt @IanWyszynski @firebase/jssdk-global-approvers
14+
packages/database @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
15+
packages/database-compat @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
16+
packages/database-types @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
4217

4318
# Firestore Code
4419
packages/firestore @firebase/firestore-js-team @firebase/jssdk-global-approvers

.github/workflows/test-all.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ jobs:
1616
steps:
1717
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
1818
- name: install Chrome stable
19+
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
20+
# Temporary: Auth team will explore what's going wrong with the auth tests.
1921
run: |
2022
sudo apt-get update
21-
sudo apt-get install google-chrome-stable
23+
sudo apt-get install wget
24+
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_110.0.5481.177-1_amd64.deb
25+
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
2226
- uses: actions/checkout@v3
2327
- name: Set up Node (16)
2428
uses: actions/setup-node@v3

.github/workflows/test-changed-auth.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
1616
- name: install Chrome stable
1717
# Install Chrome version 110.0.5481.177-1 as test starts to fail on version 111.
18-
# We will retry to use the latest, once version 112 becomes stable.
18+
# Temporary: Auth team will explore what's going wrong with the auth tests.
1919
run: |
2020
sudo apt-get update
2121
sudo apt-get install wget

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"**/node_modules": true
1111
},
1212
"typescript.tsdk": "node_modules/typescript/lib",
13-
"files.associations": { "*.json": "jsonc" }
13+
"files.associations": { "*.json": "jsonc" },
14+
"eslint.workingDirectories": [{ "mode": "auto" }]
1415
}

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please see [Environment Support](https://firebase.google.com/support/guides/envi
2929
#### Node.js
3030

3131
Before you can start working on the Firebase JS SDK, you need to have Node.js
32-
installed on your machine. The currently supported versions are `10.15.0` or greater.
32+
installed on your machine. The currently supported versions are `10.15.0` through `16.6.0`.
3333

3434
To download Node.js visit https://nodejs.org/en/download/.
3535

@@ -43,9 +43,14 @@ In addition to Node.js we use `yarn` to facilitate multi package development.
4343
To install `yarn` follow the instructions listed on their website:
4444
https://yarnpkg.com/en/docs/install
4545

46+
This repo currently supports building with yarn `1.x`. For instance, after installating yarn, run
47+
```bash
48+
$ yarn set version 1.22.11`
49+
```
50+
4651
#### Java
4752

48-
The closure compiler requires a modern Java installation. Java 8+ should be installed: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
53+
The closure compiler requires a modern Java installation. Java 11+ should be installed: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
4954

5055
#### Verify Prerequisites
5156

@@ -57,8 +62,8 @@ $ yarn -v
5762
$ java -version
5863
```
5964

60-
Your Node.js version should be `10.15.0` or greater, your `yarn` version should
61-
be `1.0.0` or greater, and your `java` version should be `1.8.0` or greater.
65+
Your `node` version should be between `10.15.0` and `16.6.0`, your `yarn` version should
66+
be between `1.0.0` and `1.22.11`, and your `java` version should be `11.0` or greater.
6267

6368
_NOTE: We will update the documentation as new versions are required, however
6469
for continuing development on the SDK, staying up to date on the stable versions
@@ -109,7 +114,7 @@ will be overwritten below.
109114
110115
Visit the "Realtime Database" section of the console and create a realtime
111116
database. When prompted to select the set of initial security rules, select
112-
any option (e.g. "Start in Production Mode") since these permission settings
117+
any option (e.g. "Start in Locked Mode") since these permission settings
113118
will be overwritten below.
114119
115120
#### Storage Setup
@@ -127,8 +132,10 @@ order to run the tests, you will need to update your bucket's CORS rules.
127132
}
128133
]
129134
```
130-
2. Install `gsutil` from https://cloud.google.com/storage/docs/gsutil_install
131-
3. Run `gsutil cors set cors.json gs://<your-cloud-storage-bucket>`
135+
1. Install `gsutil` from https://cloud.google.com/storage/docs/gsutil_install
136+
1. You will need to login if this is your first time using `gsutil`. Run `gcloud auth login`
137+
and follow the instructions to login.
138+
1. Run `gsutil cors set cors.json gs://<your-cloud-storage-bucket>`
132139
133140
For more information, visit https://firebase.google.com/docs/storage/web/download-files#cors_configuration
134141

common/api-review/auth.api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface ActionCodeInfo {
2020
multiFactorInfo?: MultiFactorInfo | null;
2121
previousEmail?: string | null;
2222
};
23-
operation: typeof ActionCodeOperation[keyof typeof ActionCodeOperation];
23+
operation: (typeof ActionCodeOperation)[keyof typeof ActionCodeOperation];
2424
}
2525

2626
// @public
@@ -456,21 +456,21 @@ export function multiFactor(user: User): MultiFactorUser;
456456

457457
// @public
458458
export interface MultiFactorAssertion {
459-
readonly factorId: typeof FactorId[keyof typeof FactorId];
459+
readonly factorId: (typeof FactorId)[keyof typeof FactorId];
460460
}
461461

462462
// @public
463463
export interface MultiFactorError extends AuthError {
464464
readonly customData: AuthError['customData'] & {
465-
readonly operationType: typeof OperationType[keyof typeof OperationType];
465+
readonly operationType: (typeof OperationType)[keyof typeof OperationType];
466466
};
467467
}
468468

469469
// @public
470470
export interface MultiFactorInfo {
471471
readonly displayName?: string | null;
472472
readonly enrollmentTime: string;
473-
readonly factorId: typeof FactorId[keyof typeof FactorId];
473+
readonly factorId: (typeof FactorId)[keyof typeof FactorId];
474474
readonly uid: string;
475475
}
476476

@@ -844,7 +844,7 @@ export interface User extends UserInfo {
844844

845845
// @public
846846
export interface UserCredential {
847-
operationType: typeof OperationType[keyof typeof OperationType];
847+
operationType: (typeof OperationType)[keyof typeof OperationType];
848848
providerId: string | null;
849849
user: User;
850850
}

common/api-review/firestore.api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ export function endBefore(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstr
184184
// @public
185185
export function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;
186186

187+
// @public
188+
export interface ExperimentalLongPollingOptions {
189+
timeoutSeconds?: number;
190+
}
191+
187192
// @public
188193
export class FieldPath {
189194
constructor(...fieldNames: string[]);
@@ -227,6 +232,7 @@ export interface FirestoreSettings {
227232
cacheSizeBytes?: number;
228233
experimentalAutoDetectLongPolling?: boolean;
229234
experimentalForceLongPolling?: boolean;
235+
experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
230236
host?: string;
231237
ignoreUndefinedProperties?: boolean;
232238
localCache?: FirestoreLocalCache;

common/api-review/storage.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export interface StorageReference {
304304
}
305305

306306
// @public
307-
export type StringFormat = typeof StringFormat[keyof typeof StringFormat];
307+
export type StringFormat = (typeof StringFormat)[keyof typeof StringFormat];
308308

309309
// @public
310310
export const StringFormat: {
@@ -329,7 +329,7 @@ export const _TaskEvent: {
329329
export type TaskState = 'running' | 'paused' | 'success' | 'canceled' | 'error';
330330

331331
// @internal
332-
export type _TaskState = typeof _TaskState[keyof typeof _TaskState];
332+
export type _TaskState = (typeof _TaskState)[keyof typeof _TaskState];
333333

334334
// @internal
335335
export const _TaskState: {

docs-devsite/auth.actioncodeinfo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface ActionCodeInfo
2323
| Property | Type | Description |
2424
| --- | --- | --- |
2525
| [data](./auth.actioncodeinfo.md#actioncodeinfodata) | { email?: string \| null; multiFactorInfo?: [MultiFactorInfo](./auth.multifactorinfo.md#multifactorinfo_interface) \| null; previousEmail?: string \| null; } | The data associated with the action code. |
26-
| [operation](./auth.actioncodeinfo.md#actioncodeinfooperation) | typeof [ActionCodeOperationMap](./auth.md#actioncodeoperation)<!-- -->\[keyof typeof [ActionCodeOperationMap](./auth.md#actioncodeoperation)<!-- -->\] | The type of operation that generated the action code. |
26+
| [operation](./auth.actioncodeinfo.md#actioncodeinfooperation) | (typeof [ActionCodeOperationMap](./auth.md#actioncodeoperation)<!-- -->)\[keyof typeof [ActionCodeOperationMap](./auth.md#actioncodeoperation)<!-- -->\] | The type of operation that generated the action code. |
2727

2828
## ActionCodeInfo.data
2929

@@ -54,5 +54,5 @@ The type of operation that generated the action code.
5454
<b>Signature:</b>
5555

5656
```typescript
57-
operation: typeof ActionCodeOperationMap[keyof typeof ActionCodeOperationMap];
57+
operation: (typeof ActionCodeOperationMap)[keyof typeof ActionCodeOperationMap];
5858
```

docs-devsite/auth.auth.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface Auth
4141
| [onAuthStateChanged(nextOrObserver, error, completed)](./auth.auth.md#authonauthstatechanged) | Adds an observer for changes to the user's sign-in state. |
4242
| [onIdTokenChanged(nextOrObserver, error, completed)](./auth.auth.md#authonidtokenchanged) | Adds an observer for changes to the signed-in user's ID token. |
4343
| [setPersistence(persistence)](./auth.auth.md#authsetpersistence) | Changes the type of persistence on the <code>Auth</code> instance. |
44-
| [signOut()](./auth.auth.md#authsignout) | Signs out the current user. |
44+
| [signOut()](./auth.auth.md#authsignout) | Signs out the current user. This does not automatically revoke the user's ID token. |
4545
| [updateCurrentUser(user)](./auth.auth.md#authupdatecurrentuser) | Asynchronously sets the provided user as [Auth.currentUser](./auth.auth.md#authcurrentuser) on the [Auth](./auth.auth.md#auth_interface) instance. |
4646
| [useDeviceLanguage()](./auth.auth.md#authusedevicelanguage) | Sets the current language to the default device/browser preference. |
4747

@@ -247,7 +247,7 @@ auth.setPersistence(browserSessionPersistence);
247247

248248
## Auth.signOut()
249249

250-
Signs out the current user.
250+
Signs out the current user. This does not automatically revoke the user's ID token.
251251

252252
<b>Signature:</b>
253253

docs-devsite/auth.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Firebase Authentication
5555
| <b>function(user...)</b> |
5656
| [deleteUser(user)](./auth.md#deleteuser) | Deletes and signs out the user. |
5757
| [getIdToken(user, forceRefresh)](./auth.md#getidtoken) | Returns a JSON Web Token (JWT) used to identify the user to a Firebase service. |
58-
| [getIdTokenResult(user, forceRefresh)](./auth.md#getidtokenresult) | Returns a deserialized JSON Web Token (JWT) used to identitfy the user to a Firebase service. |
58+
| [getIdTokenResult(user, forceRefresh)](./auth.md#getidtokenresult) | Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service. |
5959
| [linkWithCredential(user, credential)](./auth.md#linkwithcredential) | Links the user account with the given credentials. |
6060
| [linkWithPhoneNumber(user, phoneNumber, appVerifier)](./auth.md#linkwithphonenumber) | Links the user account with the given phone number. |
6161
| [linkWithPopup(user, provider, resolver)](./auth.md#linkwithpopup) | Links the authenticated provider to the user account using a pop-up based OAuth flow. |
@@ -1156,7 +1156,7 @@ Promise&lt;string&gt;
11561156

11571157
## getIdTokenResult()
11581158

1159-
Returns a deserialized JSON Web Token (JWT) used to identitfy the user to a Firebase service.
1159+
Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service.
11601160

11611161
Returns the current token if it has not expired or if it will not expire in the next five minutes. Otherwise, this will refresh the token and return a new one.
11621162

docs-devsite/auth.multifactorassertion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface MultiFactorAssertion
2424

2525
| Property | Type | Description |
2626
| --- | --- | --- |
27-
| [factorId](./auth.multifactorassertion.md#multifactorassertionfactorid) | typeof [FactorIdMap](./auth.md#factorid)<!-- -->\[keyof typeof [FactorIdMap](./auth.md#factorid)<!-- -->\] | The identifier of the second factor. |
27+
| [factorId](./auth.multifactorassertion.md#multifactorassertionfactorid) | (typeof [FactorIdMap](./auth.md#factorid)<!-- -->)\[keyof typeof [FactorIdMap](./auth.md#factorid)<!-- -->\] | The identifier of the second factor. |
2828

2929
## MultiFactorAssertion.factorId
3030

@@ -33,5 +33,5 @@ The identifier of the second factor.
3333
<b>Signature:</b>
3434

3535
```typescript
36-
readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap];
36+
readonly factorId: (typeof FactorIdMap)[keyof typeof FactorIdMap];
3737
```

docs-devsite/auth.multifactorerror.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface MultiFactorError extends AuthError
2525
2626
| Property | Type | Description |
2727
| --- | --- | --- |
28-
| [customData](./auth.multifactorerror.md#multifactorerrorcustomdata) | [AuthError](./auth.autherror.md#autherror_interface)<!-- -->\['customData'\] &amp; { readonly operationType: typeof [OperationTypeMap](./auth.md#operationtype)<!-- -->\[keyof typeof [OperationTypeMap](./auth.md#operationtype)<!-- -->\]; } | Details about the MultiFactorError. |
28+
| [customData](./auth.multifactorerror.md#multifactorerrorcustomdata) | [AuthError](./auth.autherror.md#autherror_interface)<!-- -->\['customData'\] &amp; { readonly operationType: (typeof [OperationTypeMap](./auth.md#operationtype)<!-- -->)\[keyof typeof [OperationTypeMap](./auth.md#operationtype)<!-- -->\]; } | Details about the MultiFactorError. |
2929
3030
## MultiFactorError.customData
3131
@@ -35,7 +35,7 @@ Details about the MultiFactorError.
3535
3636
```typescript
3737
readonly customData: AuthError['customData'] & {
38-
readonly operationType: typeof OperationTypeMap[keyof typeof OperationTypeMap];
38+
readonly operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap];
3939
};
4040
```
4141

docs-devsite/auth.multifactorinfo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface MultiFactorInfo
2424
| --- | --- | --- |
2525
| [displayName](./auth.multifactorinfo.md#multifactorinfodisplayname) | string \| null | The user friendly name of the current second factor. |
2626
| [enrollmentTime](./auth.multifactorinfo.md#multifactorinfoenrollmenttime) | string | The enrollment date of the second factor formatted as a UTC string. |
27-
| [factorId](./auth.multifactorinfo.md#multifactorinfofactorid) | typeof [FactorIdMap](./auth.md#factorid)<!-- -->\[keyof typeof [FactorIdMap](./auth.md#factorid)<!-- -->\] | The identifier of the second factor. |
27+
| [factorId](./auth.multifactorinfo.md#multifactorinfofactorid) | (typeof [FactorIdMap](./auth.md#factorid)<!-- -->)\[keyof typeof [FactorIdMap](./auth.md#factorid)<!-- -->\] | The identifier of the second factor. |
2828
| [uid](./auth.multifactorinfo.md#multifactorinfouid) | string | The multi-factor enrollment ID. |
2929

3030
## MultiFactorInfo.displayName
@@ -54,7 +54,7 @@ The identifier of the second factor.
5454
<b>Signature:</b>
5555

5656
```typescript
57-
readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap];
57+
readonly factorId: (typeof FactorIdMap)[keyof typeof FactorIdMap];
5858
```
5959

6060
## MultiFactorInfo.uid

0 commit comments

Comments
 (0)