Skip to content

Commit 169b5cc

Browse files
committed
Merge remote-tracking branch 'origin/master' into mtewani/fix-transactions
2 parents fbe94aa + 2b2079d commit 169b5cc

File tree

55 files changed

+550
-327
lines changed

Some content is hidden

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

55 files changed

+550
-327
lines changed

.changeset/calm-pugs-leave.md

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

.changeset/five-yaks-travel.md

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

.changeset/honest-waves-brake.md

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

.changeset/kind-pots-admire.md

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

.changeset/smart-crabs-warn.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@firebase/database": patch
3+
---
4+
5+
Fix issue with how get results for filtered queries are added to cache.
6+
Fix issue with events not getting propagated to listeners by get.

common/api-review/firestore.api.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -233,30 +233,6 @@ export function getFirestore(app?: FirebaseApp): Firestore;
233233
// @public
234234
export function increment(n: number): FieldValue;
235235

236-
// @public
237-
export interface Index {
238-
// (undocumented)
239-
[key: string]: unknown;
240-
readonly collectionGroup: string;
241-
readonly fields?: IndexField[];
242-
}
243-
244-
// @public
245-
export interface IndexConfiguration {
246-
// (undocumented)
247-
[key: string]: unknown;
248-
readonly indexes?: Index[];
249-
}
250-
251-
// @public
252-
export interface IndexField {
253-
// (undocumented)
254-
[key: string]: unknown;
255-
readonly arrayConfig?: 'CONTAINS';
256-
readonly fieldPath: string;
257-
readonly order?: 'ASCENDING' | 'DESCENDING';
258-
}
259-
260236
// @public
261237
export function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
262238

@@ -420,12 +396,6 @@ export function setDoc<T>(reference: DocumentReference<T>, data: WithFieldValue<
420396
// @public
421397
export function setDoc<T>(reference: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): Promise<void>;
422398

423-
// @public
424-
export function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;
425-
426-
// @public
427-
export function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
428-
429399
// @public
430400
export function setLogLevel(logLevel: LogLevel): void;
431401

integration/compat-interop/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"test:debug": "karma start --browsers Chrome --auto-watch"
99
},
1010
"dependencies": {
11-
"@firebase/app": "0.7.29",
12-
"@firebase/app-compat": "0.1.30",
11+
"@firebase/app": "0.7.30",
12+
"@firebase/app-compat": "0.1.31",
1313
"@firebase/analytics": "0.8.0",
1414
"@firebase/analytics-compat": "0.1.13",
1515
"@firebase/auth": "0.20.5",

integration/firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
10-
"firebase": "9.9.1",
10+
"firebase": "9.9.2",
1111
"@types/chai": "4.3.1",
1212
"@types/mocha": "9.1.1",
1313
"chai": "4.3.6",

integration/firestore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome"
1616
},
1717
"dependencies": {
18-
"@firebase/app": "0.7.29",
19-
"@firebase/firestore": "3.4.13"
18+
"@firebase/app": "0.7.30",
19+
"@firebase/firestore": "3.4.14"
2020
},
2121
"devDependencies": {
2222
"@types/mocha": "9.1.1",

integration/messaging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test:manual": "mocha --exit"
1010
},
1111
"devDependencies": {
12-
"firebase": "9.9.1",
12+
"firebase": "9.9.2",
1313
"chai": "4.3.6",
1414
"chromedriver": "98.0.1",
1515
"express": "4.18.1",

packages/analytics-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@firebase/app-compat": "0.x"
2525
},
2626
"devDependencies": {
27-
"@firebase/app-compat": "0.1.30",
27+
"@firebase/app-compat": "0.1.31",
2828
"rollup": "2.72.1",
2929
"@rollup/plugin-json": "4.1.0",
3030
"rollup-plugin-typescript2": "0.31.2",

packages/analytics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"license": "Apache-2.0",
5050
"devDependencies": {
51-
"@firebase/app": "0.7.29",
51+
"@firebase/app": "0.7.30",
5252
"rollup": "2.72.1",
5353
"@rollup/plugin-commonjs": "21.1.0",
5454
"@rollup/plugin-json": "4.1.0",

packages/app-check-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"license": "Apache-2.0",
4646
"devDependencies": {
47-
"@firebase/app-compat": "0.1.30",
47+
"@firebase/app-compat": "0.1.31",
4848
"rollup": "2.72.1",
4949
"@rollup/plugin-commonjs": "21.1.0",
5050
"@rollup/plugin-json": "4.1.0",

packages/app-check/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"license": "Apache-2.0",
4747
"devDependencies": {
48-
"@firebase/app": "0.7.29",
48+
"@firebase/app": "0.7.30",
4949
"rollup": "2.72.1",
5050
"@rollup/plugin-commonjs": "21.1.0",
5151
"@rollup/plugin-json": "4.1.0",

packages/app-compat/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @firebase/app-compat
22

3+
## 0.1.31
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`82a6add13`](https://github.com/firebase/firebase-js-sdk/commit/82a6add1354fe7e4ac1d444157ac027cdd41da6e)]:
8+
- @firebase/app@0.7.30
9+
310
## 0.1.30
411

512
### Patch Changes

packages/app-compat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/app-compat",
3-
"version": "0.1.30",
3+
"version": "0.1.31",
44
"description": "The primary entrypoint to the Firebase JS SDK",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.cjs.js",
@@ -40,7 +40,7 @@
4040
},
4141
"license": "Apache-2.0",
4242
"dependencies": {
43-
"@firebase/app": "0.7.29",
43+
"@firebase/app": "0.7.30",
4444
"@firebase/util": "1.6.3",
4545
"@firebase/logger": "0.3.3",
4646
"@firebase/component": "0.5.17",

packages/app/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @firebase/app
22

3+
## 0.7.30
4+
5+
### Patch Changes
6+
7+
- [`82a6add13`](https://github.com/firebase/firebase-js-sdk/commit/82a6add1354fe7e4ac1d444157ac027cdd41da6e) [#6480](https://github.com/firebase/firebase-js-sdk/pull/6480) - Prevent core app from throwing if IndexedDB heartbeat functions throw.
8+
39
## 0.7.29
410

511
### Patch Changes

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/app",
3-
"version": "0.7.29",
3+
"version": "0.7.30",
44
"description": "The primary entrypoint to the Firebase JS SDK",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.cjs.js",

packages/auth-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
"license": "Apache-2.0",
5757
"devDependencies": {
58-
"@firebase/app-compat": "0.1.30",
58+
"@firebase/app-compat": "0.1.31",
5959
"@rollup/plugin-json": "4.1.0",
6060
"rollup": "2.72.1",
6161
"rollup-plugin-replace": "2.2.0",

packages/auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
},
112112
"license": "Apache-2.0",
113113
"devDependencies": {
114-
"@firebase/app": "0.7.29",
114+
"@firebase/app": "0.7.30",
115115
"@rollup/plugin-json": "4.1.0",
116116
"@rollup/plugin-strip": "2.1.0",
117117
"chromedriver": "98.0.1",

packages/database-compat/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @firebase/database-compat
22

3+
## 0.2.4
4+
5+
### Patch Changes
6+
7+
- [`65838089d`](https://github.com/firebase/firebase-js-sdk/commit/65838089da47965e5e39e58c76a81a74666b215e) [#6374](https://github.com/firebase/firebase-js-sdk/pull/6374) (fixes [#6368](https://github.com/firebase/firebase-js-sdk/issues/6368)) - Updated type of action parameter for DataSnapshot#forEach
8+
9+
- Updated dependencies [[`65838089d`](https://github.com/firebase/firebase-js-sdk/commit/65838089da47965e5e39e58c76a81a74666b215e)]:
10+
- @firebase/database@0.13.4
11+
- @firebase/database-types@0.9.12
12+
313
## 0.2.3
414

515
### Patch Changes

packages/database-compat/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/database-compat",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "The Realtime Database component of the Firebase JS SDK.",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.js",
@@ -45,15 +45,15 @@
4545
"add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database"
4646
},
4747
"dependencies": {
48-
"@firebase/database": "0.13.3",
49-
"@firebase/database-types": "0.9.11",
48+
"@firebase/database": "0.13.4",
49+
"@firebase/database-types": "0.9.12",
5050
"@firebase/logger": "0.3.3",
5151
"@firebase/util": "1.6.3",
5252
"@firebase/component": "0.5.17",
5353
"tslib": "^2.1.0"
5454
},
5555
"devDependencies": {
56-
"@firebase/app-compat": "0.1.30"
56+
"@firebase/app-compat": "0.1.31"
5757
},
5858
"repository": {
5959
"directory": "packages/database-compat",

packages/database-compat/test/info.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ describe('.info Tests', function () {
130130

131131
await ea.promise;
132132

133-
expect(typeof offsets[0]).to.equal('number');
134-
expect(offsets[0]).not.to.be.greaterThan(0);
133+
expect(offsets[0]).to.be.a('number');
135134

136135
// Make sure push still works
137136
ref.push();

packages/database-types/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @firebase/database-types
22

3+
## 0.9.12
4+
5+
### Patch Changes
6+
7+
- [`65838089d`](https://github.com/firebase/firebase-js-sdk/commit/65838089da47965e5e39e58c76a81a74666b215e) [#6374](https://github.com/firebase/firebase-js-sdk/pull/6374) (fixes [#6368](https://github.com/firebase/firebase-js-sdk/issues/6368)) - Updated type of action parameter for DataSnapshot#forEach
8+
39
## 0.9.11
410

511
### Patch Changes

packages/database-types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/database-types",
3-
"version": "0.9.11",
3+
"version": "0.9.12",
44
"description": "@firebase/database Types",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"license": "Apache-2.0",

packages/database/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Unreleased
22

3+
## 0.13.4
4+
5+
### Patch Changes
6+
7+
- [`65838089d`](https://github.com/firebase/firebase-js-sdk/commit/65838089da47965e5e39e58c76a81a74666b215e) [#6374](https://github.com/firebase/firebase-js-sdk/pull/6374) (fixes [#6368](https://github.com/firebase/firebase-js-sdk/issues/6368)) - Updated type of action parameter for DataSnapshot#forEach
8+
39
## 0.13.3
410

511
### Patch Changes

packages/database/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/database",
3-
"version": "0.13.3",
3+
"version": "0.13.4",
44
"description": "",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"main": "dist/index.node.cjs.js",
@@ -53,7 +53,7 @@
5353
"tslib": "^2.1.0"
5454
},
5555
"devDependencies": {
56-
"@firebase/app": "0.7.29",
56+
"@firebase/app": "0.7.30",
5757
"rollup": "2.72.1",
5858
"rollup-plugin-typescript2": "0.31.2",
5959
"typescript": "4.2.2"

packages/database/src/api/Reference_impl.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ import { parseRepoInfo } from '../core/util/libs/parser';
3939
import { nextPushId } from '../core/util/NextPushId';
4040
import {
4141
Path,
42-
pathChild,
4342
pathEquals,
4443
pathGetBack,
4544
pathGetFront,
46-
pathIsEmpty,
45+
pathChild,
4746
pathParent,
48-
pathToUrlEncodedString
47+
pathToUrlEncodedString,
48+
pathIsEmpty
4949
} from '../core/util/Path';
5050
import {
5151
fatal,
@@ -246,7 +246,6 @@ function validateLimit(params: QueryParams) {
246246
);
247247
}
248248
}
249-
250249
/**
251250
* @internal
252251
*/
@@ -465,6 +464,7 @@ export class DataSnapshot {
465464
return this._node.val();
466465
}
467466
}
467+
468468
/**
469469
*
470470
* Returns a `Reference` representing the location in the Database
@@ -525,7 +525,6 @@ export function refFromURL(db: Database, url: string): DatabaseReference {
525525

526526
return ref(db, parsedURL.path.toString());
527527
}
528-
529528
/**
530529
* Gets a `Reference` for the location at the specified relative path.
531530
*
@@ -811,15 +810,16 @@ export function update(ref: DatabaseReference, values: object): Promise<void> {
811810
*/
812811
export function get(query: Query): Promise<DataSnapshot> {
813812
query = getModularInstance(query) as QueryImpl;
814-
return repoGetValue(query._repo, query).then(node => {
813+
const callbackContext = new CallbackContext(() => {});
814+
const container = new ValueEventRegistration(callbackContext);
815+
return repoGetValue(query._repo, query, container).then(node => {
815816
return new DataSnapshot(
816817
node,
817818
new ReferenceImpl(query._repo, query._path),
818819
query._queryParams.getIndex()
819820
);
820821
});
821822
}
822-
823823
/**
824824
* Represents registration for 'value' events.
825825
*/

0 commit comments

Comments
 (0)