Skip to content

Commit 2cdb529

Browse files
Merge master into release
2 parents 242a347 + 7bde55c commit 2cdb529

Some content is hidden

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

47 files changed

+679
-221
lines changed

.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/long-lemons-change.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+
Enabled long-polling networking mode auto detection by default. It can be explicitly disabled by setting `FirestoreSettings.experimentalForceLongPolling` to `false`.

.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/small-chairs-explain.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+
Allow port numbers in authDomain

.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 `experimentalLongPollingOptions.timeoutSeconds` setting
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: 🐞 Bug Report V2
2+
description: File a bug report
3+
title: '[Bug]: '
4+
body:
5+
- type: markdown
6+
id: before-you-start
7+
attributes:
8+
value: |
9+
*[READ THIS]:* to evaluate if you are in the right place?
10+
- For issues or feature requests related to __the code in this repository__, file a Github issue.
11+
- If this is a __feature request__, make sure the issue title starts with "FR:".
12+
- For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/) with the firebase tag.
13+
- For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk) google group.
14+
- For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized [Firebase support channel](https://firebase.google.com/support/).
15+
- type: input
16+
id: operating-system
17+
attributes:
18+
label: Operating System
19+
description: Describe your operating system
20+
placeholder: ex. iOS 16.4
21+
validations:
22+
required: true
23+
- type: input
24+
id: browser-version
25+
attributes:
26+
label: Browser Version
27+
description: Describe your browser version
28+
placeholder: ex. Safari/604.1
29+
validations:
30+
required: true
31+
- type: input
32+
id: firebase-sdk-version
33+
attributes:
34+
label: Firebase SDK Version
35+
description: Describe your Firebase SDK Version
36+
placeholder: ex. 9.16.0
37+
validations:
38+
required: true
39+
- type: dropdown
40+
id: firebase-sdk-products
41+
attributes:
42+
label: 'Firebase SDK Product:'
43+
description: Which Firebase Products are used in your app?
44+
multiple: true
45+
options:
46+
- Analytics
47+
- AppCheck
48+
- Auth
49+
- Component
50+
- Database
51+
- Firestore
52+
- Functions
53+
- Installations
54+
- Logger
55+
- Messaging
56+
- Performance
57+
- Remote-Config
58+
- Storage
59+
validations:
60+
required: true
61+
- type: textarea
62+
id: project-tooling
63+
attributes:
64+
label: Describe your project's tooling
65+
description: Describe the tooling your app is built with
66+
placeholder: React app with Webpack and Jest
67+
validations:
68+
required: true
69+
- type: textarea
70+
id: describe-your-problem
71+
attributes:
72+
label: Describe the problem
73+
description: Describe what you were trying to do and what occurred
74+
placeholder: |
75+
What were you trying to accomplish? What happened? This should include a background description, log/console output, etc.
76+
validations:
77+
required: true
78+
- type: textarea
79+
id: reproduce-code
80+
attributes:
81+
label: Steps and code to reproduce issue
82+
description: Please provide a description of how to replicate your issue. Copy and paste any relevant code here to reproduce the problem or links to code to reproduce it.
83+
validations:
84+
required: true

.github/workflows/release-staging.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,16 @@ jobs:
134134
https://api.github.com/repos/firebase/firebase-js-sdk/dispatches
135135
- name: Check for changes requiring a reference doc publish
136136
id: docs-check
137+
# If a diff is found (length of DIFF_CONTENTS > 0) it will write DOCS_NEEDED=true
137138
run: |
138139
LAST_PUBLISHED_VERSION=$(npm info firebase version)
139-
git diff --exit-code firebase@$LAST_PUBLISHED_VERSION HEAD docs-devsite
140-
- name: No diff, docs not needed
141-
if: ${{ success() }}
142-
run: echo "DOCS_NEEDED=false" >> $GITHUB_STATE
143-
- name: Diff returned something, docs are needed
144-
if: ${{ failure() }}
145-
run: echo "DOCS_NEEDED=true" >> $GITHUB_STATE
140+
DIFF_CONTENTS=$(git diff firebase@$LAST_PUBLISHED_VERSION HEAD docs-devsite)
141+
if [ -n "$DIFF_CONTENTS" ]
142+
then
143+
echo "DOCS_NEEDED=true" >> $GITHUB_OUTPUT
144+
else
145+
echo "DOCS_NEEDED=false" >> $GITHUB_OUTPUT
146+
fi
146147
- name: Log to release tracker
147148
# Sends release information to cloud functions endpoint of release tracker.
148149
if: ${{ always() }}

.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ https://yarnpkg.com/en/docs/install
4545

4646
This repo currently supports building with yarn `1.x`. For instance, after installating yarn, run
4747
```bash
48-
$ yarn set version 1.22.11`
48+
$ yarn set version 1.22.11
4949
```
5050

5151
#### Java

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;

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.user.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface User extends UserInfo
3636
| --- | --- |
3737
| [delete()](./auth.user.md#userdelete) | Deletes and signs out the user. |
3838
| [getIdToken(forceRefresh)](./auth.user.md#usergetidtoken) | Returns a JSON Web Token (JWT) used to identify the user to a Firebase service. |
39-
| [getIdTokenResult(forceRefresh)](./auth.user.md#usergetidtokenresult) | Returns a deserialized JSON Web Token (JWT) used to identitfy the user to a Firebase service. |
39+
| [getIdTokenResult(forceRefresh)](./auth.user.md#usergetidtokenresult) | Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service. |
4040
| [reload()](./auth.user.md#userreload) | Refreshes the user, if signed in. |
4141
| [toJSON()](./auth.user.md#usertojson) | Returns a JSON-serializable representation of this object. |
4242
@@ -154,7 +154,7 @@ Promise&lt;string&gt;
154154
155155
## User.getIdTokenResult()
156156
157-
Returns a deserialized JSON Web Token (JWT) used to identitfy the user to a Firebase service.
157+
Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service.
158158
159159
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.
160160
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# ExperimentalLongPollingOptions interface
13+
Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.
14+
15+
Note: This interface is "experimental" and is subject to change.
16+
17+
See `FirestoreSettings.experimentalAutoDetectLongPolling`<!-- -->, `FirestoreSettings.experimentalForceLongPolling`<!-- -->, and `FirestoreSettings.experimentalLongPollingOptions`<!-- -->.
18+
19+
<b>Signature:</b>
20+
21+
```typescript
22+
export declare interface ExperimentalLongPollingOptions
23+
```
24+
25+
## Properties
26+
27+
| Property | Type | Description |
28+
| --- | --- | --- |
29+
| [timeoutSeconds](./firestore_.experimentallongpollingoptions.md#experimentallongpollingoptionstimeoutseconds) | number | The desired maximum timeout interval, in seconds, to complete a long-polling GET response. Valid values are between 5 and 30, inclusive. Floating point values are allowed and will be rounded to the nearest millisecond.<!-- -->By default, when long-polling is used the "hanging GET" request sent by the client times out after 30 seconds. To request a different timeout from the server, set this setting with the desired timeout.<!-- -->Changing the default timeout may be useful, for example, if the buffering proxy that necessitated enabling long-polling in the first place has a shorter timeout for hanging GET requests, in which case setting the long-polling timeout to a shorter value, such as 25 seconds, may fix prematurely-closed hanging GET requests. For example, see https://github.com/firebase/firebase-js-sdk/issues/6987. |
30+
31+
## ExperimentalLongPollingOptions.timeoutSeconds
32+
33+
The desired maximum timeout interval, in seconds, to complete a long-polling GET response. Valid values are between 5 and 30, inclusive. Floating point values are allowed and will be rounded to the nearest millisecond.
34+
35+
By default, when long-polling is used the "hanging GET" request sent by the client times out after 30 seconds. To request a different timeout from the server, set this setting with the desired timeout.
36+
37+
Changing the default timeout may be useful, for example, if the buffering proxy that necessitated enabling long-polling in the first place has a shorter timeout for hanging GET requests, in which case setting the long-polling timeout to a shorter value, such as 25 seconds, may fix prematurely-closed hanging GET requests. For example, see https://github.com/firebase/firebase-js-sdk/issues/6987.
38+
39+
<b>Signature:</b>
40+
41+
```typescript
42+
timeoutSeconds?: number;
43+
```

docs-devsite/firestore_.firestoresettings.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ export declare interface FirestoreSettings
2323
| Property | Type | Description |
2424
| --- | --- | --- |
2525
| [cacheSizeBytes](./firestore_.firestoresettings.md#firestoresettingscachesizebytes) | number | NOTE: This field will be deprecated in a future major release. Use <code>cache</code> field instead to specify cache size, and other cache configurations.<!-- -->An approximate cache size threshold for the on-disk data. If the cache grows beyond this size, Firestore will start removing data that hasn't been recently used. The size is not a guarantee that the cache will stay below that size, only that if the cache exceeds the given size, cleanup will be attempted.<!-- -->The default value is 40 MB. The threshold must be set to at least 1 MB, and can be set to <code>CACHE_SIZE_UNLIMITED</code> to disable garbage collection. |
26-
| [experimentalAutoDetectLongPolling](./firestore_.firestoresettings.md#firestoresettingsexperimentalautodetectlongpolling) | boolean | Configures the SDK's underlying transport (WebChannel) to automatically detect if long-polling should be used. This is very similar to <code>experimentalForceLongPolling</code>, but only uses long-polling if required.<!-- -->This setting will likely be enabled by default in future releases and cannot be combined with <code>experimentalForceLongPolling</code>. |
26+
| [experimentalAutoDetectLongPolling](./firestore_.firestoresettings.md#firestoresettingsexperimentalautodetectlongpolling) | boolean | Configures the SDK's underlying transport (WebChannel) to automatically detect if long-polling should be used. This is very similar to <code>experimentalForceLongPolling</code>, but only uses long-polling if required.<!-- -->After having had a default value of <code>false</code> since its inception in 2019, the default value of this setting was changed in mid-2023 to <code>true</code>. That is, auto-detection of long polling is now enabled by default. To disable it, set this setting to <code>false</code>, and please open a GitHub issue to share the problems that motivated you disabling long-polling auto-detection. |
2727
| [experimentalForceLongPolling](./firestore_.firestoresettings.md#firestoresettingsexperimentalforcelongpolling) | boolean | Forces the SDKs underlying network transport (WebChannel) to use long-polling. Each response from the backend will be closed immediately after the backend sends data (by default responses are kept open in case the backend has more data to send). This avoids incompatibility issues with certain proxies, antivirus software, etc. that incorrectly buffer traffic indefinitely. Use of this option will cause some performance degradation though.<!-- -->This setting cannot be used with <code>experimentalAutoDetectLongPolling</code> and may be removed in a future release. If you find yourself using it to work around a specific network reliability issue, please tell us about it in https://github.com/firebase/firebase-js-sdk/issues/1674. |
28+
| [experimentalLongPollingOptions](./firestore_.firestoresettings.md#firestoresettingsexperimentallongpollingoptions) | [ExperimentalLongPollingOptions](./firestore_.experimentallongpollingoptions.md#experimentallongpollingoptions_interface) | Options that configure the SDKs underlying network transport (WebChannel) when long-polling is used.<!-- -->These options are only used if <code>experimentalForceLongPolling</code> is true or if <code>experimentalAutoDetectLongPolling</code> is true and the auto-detection determined that long-polling was needed. Otherwise, these options have no effect. |
2829
| [host](./firestore_.firestoresettings.md#firestoresettingshost) | string | The hostname to connect to. |
2930
| [ignoreUndefinedProperties](./firestore_.firestoresettings.md#firestoresettingsignoreundefinedproperties) | boolean | Whether to skip nested properties that are set to <code>undefined</code> during object serialization. If set to <code>true</code>, these properties are skipped and not written to Firestore. If set to <code>false</code> or omitted, the SDK throws an exception when it encounters properties of type <code>undefined</code>. |
3031
| [localCache](./firestore_.firestoresettings.md#firestoresettingslocalcache) | [FirestoreLocalCache](./firestore_.md#firestorelocalcache) | Specifies the cache used by the SDK. Available options are <code>MemoryLocalCache</code> and <code>IndexedDbLocalCache</code>, each with different configuration options.<!-- -->When unspecified, <code>MemoryLocalCache</code> will be used by default.<!-- -->NOTE: setting this field and <code>cacheSizeBytes</code> at the same time will throw exception during SDK initialization. Instead, using the configuration in the <code>FirestoreLocalCache</code> object to specify the cache size. |
@@ -48,7 +49,7 @@ cacheSizeBytes?: number;
4849

4950
Configures the SDK's underlying transport (WebChannel) to automatically detect if long-polling should be used. This is very similar to `experimentalForceLongPolling`<!-- -->, but only uses long-polling if required.
5051

51-
This setting will likely be enabled by default in future releases and cannot be combined with `experimentalForceLongPolling`<!-- -->.
52+
After having had a default value of `false` since its inception in 2019, the default value of this setting was changed in mid-2023 to `true`<!-- -->. That is, auto-detection of long polling is now enabled by default. To disable it, set this setting to `false`<!-- -->, and please open a GitHub issue to share the problems that motivated you disabling long-polling auto-detection.
5253

5354
<b>Signature:</b>
5455

@@ -68,6 +69,18 @@ This setting cannot be used with `experimentalAutoDetectLongPolling` and may be
6869
experimentalForceLongPolling?: boolean;
6970
```
7071

72+
## FirestoreSettings.experimentalLongPollingOptions
73+
74+
Options that configure the SDKs underlying network transport (WebChannel) when long-polling is used.
75+
76+
These options are only used if `experimentalForceLongPolling` is true or if `experimentalAutoDetectLongPolling` is true and the auto-detection determined that long-polling was needed. Otherwise, these options have no effect.
77+
78+
<b>Signature:</b>
79+
80+
```typescript
81+
experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
82+
```
83+
7184
## FirestoreSettings.host
7285

7386
The hostname to connect to.

0 commit comments

Comments
 (0)