Skip to content

Commit

Permalink
Merge master into release
Browse files Browse the repository at this point in the history
  • Loading branch information
google-oss-bot authored Sep 12, 2023
2 parents b2f6084 + 98cfcbd commit aa0f8a9
Show file tree
Hide file tree
Showing 85 changed files with 3,395 additions and 1,446 deletions.
6 changes: 6 additions & 0 deletions .changeset/fresh-frogs-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@firebase/firestore": patch
"@firebase/webchannel-wrapper": patch
---

Fix an issue where Firestore was incorrectly using XHR instead of fetch for streaming response.
6 changes: 6 additions & 0 deletions .changeset/hip-cougars-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@firebase/firestore': minor
'firebase': minor
---

Add `enablePersistentCacheIndexAutoCreation()` function to enable automatic creation of local cache query indexes, which can improve performance of local query execution.
6 changes: 6 additions & 0 deletions .changeset/lucky-horses-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@firebase/rules-unit-testing': patch
'@firebase/firestore': patch
---

Updated minor dependencies grpc (firestore) and firebase-admin (rules-unit-testing).
18 changes: 10 additions & 8 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
# setting up the repo. This must be done to build and execute Auth properly.
- name: install Chrome stable
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
# Temporary: Auth team will explore what's going wrong with the auth tests.
# Pin Chrome version 114.0.5735.90-1 to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790".
# The failure happens because https://chromedriver.chromium.org/downloads only goes up to version 114.
# TODO(b/297380444) Update script to install the latest Chrome and ChromeDriver.
run: |
sudo apt-get update
sudo apt-get install wget
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
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
sudo apt-get install -f ./google-chrome-stable_114.0.5735.90-1_amd64.deb --allow-downgrades
- uses: actions/checkout@v3
- name: Set up Node (16)
uses: actions/setup-node@v3
Expand Down Expand Up @@ -102,13 +103,14 @@ jobs:
steps:
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
# Temporary: Auth team will explore what's going wrong with the auth tests.
# Pin Chrome version 114.0.5735.90-1 to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790".
# The failure happens because https://chromedriver.chromium.org/downloads only goes up to version 114.
# TODO(b/297380444) Update script to install the latest Chrome and ChromeDriver.
run: |
sudo apt-get update
sudo apt-get install wget
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
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
sudo apt-get install -f ./google-chrome-stable_114.0.5735.90-1_amd64.deb --allow-downgrades
- name: Download build archive
uses: actions/download-artifact@v3
with:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/test-changed-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ jobs:
steps:
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
# Install Chrome version 110.0.5481.177-1 as test starts to fail on version 111.
# Temporary: Auth team will explore what's going wrong with the auth tests.
# Pin Chrome version 114.0.5735.90-1 to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790".
# The failure happens because https://chromedriver.chromium.org/downloads only goes up to version 114.
# TODO(b/297380444) Update script to install the latest Chrome and ChromeDriver.
run: |
sudo apt-get update
sudo apt-get install wget
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
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
sudo apt-get install -f ./google-chrome-stable_114.0.5735.90-1_amd64.deb --allow-downgrades
- name: Checkout Repo
uses: actions/checkout@master
with:
Expand Down Expand Up @@ -48,16 +49,17 @@ jobs:

runs-on: ubuntu-20.04

# Chrome webdriver version is pinned to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790"
# These are installed even in the Firefox test due to `yarn` command which pulls the devDependency listed in package.json.
# Pin Chrome version 114.0.5735.90-1 to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790".
# The failure happens because https://chromedriver.chromium.org/downloads only goes up to version 114.
# TODO(b/297380444) Update script to install the latest Chrome and ChromeDriver.
steps:
- name: install Firefox stable
run: |
sudo apt-get update
sudo apt-get install firefox
sudo apt-get install wget
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
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
sudo apt-get install -f ./google-chrome-stable_114.0.5735.90-1_amd64.deb --allow-downgrades
- name: Checkout Repo
uses: actions/checkout@master
Expand Down
27 changes: 22 additions & 5 deletions common/api-review/firestore.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export function connectFirestoreEmulator(firestore: Firestore, host: string, por
mockUserToken?: EmulatorMockTokenOptions | string;
}): void;

// @public
export function deleteAllPersistentCacheIndexes(indexManager: PersistentCacheIndexManager): void;

// @public
export function deleteDoc<AppModelType, DbModelType extends DocumentData>(reference: DocumentReference<AppModelType, DbModelType>): Promise<void>;

Expand All @@ -110,6 +113,9 @@ export function deleteField(): FieldValue;
// @public
export function disableNetwork(firestore: Firestore): Promise<void>;

// @public
export function disablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void;

// @public
export function doc(firestore: Firestore, path: string, ...pathSegments: string[]): DocumentReference<DocumentData, DocumentData>;

Expand Down Expand Up @@ -172,6 +178,9 @@ export function enableMultiTabIndexedDbPersistence(firestore: Firestore): Promis
// @public
export function enableNetwork(firestore: Firestore): Promise<void>;

// @public
export function enablePersistentCacheIndexAutoCreation(indexManager: PersistentCacheIndexManager): void;

// @public
export function endAt<AppModelType, DbModelType extends DocumentData>(snapshot: DocumentSnapshot<AppModelType, DbModelType>): QueryEndAtConstraint;

Expand Down Expand Up @@ -286,25 +295,28 @@ export function getFirestore(): Firestore;
// @beta
export function getFirestore(app: FirebaseApp, databaseId: string): Firestore;

// @public
export function getPersistentCacheIndexManager(firestore: Firestore): PersistentCacheIndexManager | null;

// @public
export function increment(n: number): FieldValue;

// @beta
// @beta @deprecated
export interface Index {
// (undocumented)
[key: string]: unknown;
readonly collectionGroup: string;
readonly fields?: IndexField[];
}

// @beta
// @beta @deprecated
export interface IndexConfiguration {
// (undocumented)
[key: string]: unknown;
readonly indexes?: Index[];
}

// @beta
// @beta @deprecated
export interface IndexField {
// (undocumented)
[key: string]: unknown;
Expand Down Expand Up @@ -457,6 +469,11 @@ export interface PersistenceSettings {
forceOwnership?: boolean;
}

// @public
export class PersistentCacheIndexManager {
readonly type: 'PersistentCacheIndexManager';
}

// @public
export interface PersistentCacheSettings {
cacheSizeBytes?: number;
Expand Down Expand Up @@ -596,10 +613,10 @@ export function setDoc<AppModelType, DbModelType extends DocumentData>(reference
// @public
export function setDoc<AppModelType, DbModelType extends DocumentData>(reference: DocumentReference<AppModelType, DbModelType>, data: PartialWithFieldValue<AppModelType>, options: SetOptions): Promise<void>;

// @beta
// @beta @deprecated
export function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;

// @beta
// @beta @deprecated
export function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;

// @public
Expand Down
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.9.0",
"firebase-admin": "11.10.1",
"firebase-functions": "3.24.1"
},
"private": true,
Expand Down
5 changes: 5 additions & 0 deletions docs-devsite/firestore_.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
> Warning: This API is now obsolete.
>
> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally.
>
The SDK definition of a Firestore index.

<b>Signature:</b>
Expand Down
5 changes: 5 additions & 0 deletions docs-devsite/firestore_.indexconfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
> Warning: This API is now obsolete.
>
> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally.
>
A list of Firestore indexes to speed up local query execution.

See [JSON Format](https://firebase.google.com/docs/reference/firestore/indexes/#json_format) for a description of the format of the index definition.
Expand Down
5 changes: 5 additions & 0 deletions docs-devsite/firestore_.indexfield.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ https://github.com/firebase/firebase-js-sdk
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
> Warning: This API is now obsolete.
>
> Instead of creating cache indexes manually, consider using `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to create cache indexes for queries running locally.
>
A single field element in an index configuration.

<b>Signature:</b>
Expand Down
Loading

0 comments on commit aa0f8a9

Please sign in to comment.