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 Oct 12, 2022
2 parents 7846076 + 807f06a commit 6d4e08a
Show file tree
Hide file tree
Showing 25 changed files with 9,227 additions and 227 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-houses-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/storage": patch
---

Cleared retry timeouts when uploads are paused/canceled
5 changes: 5 additions & 0 deletions .changeset/grumpy-suits-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/util': patch
---

Catch errors when the SDK checks for `__FIREBASE_DEFAULTS__` and do not block other app functionality.
5 changes: 5 additions & 0 deletions .changeset/moody-icons-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/analytics': patch
---

Correct `id` type in `setUserId`
2 changes: 1 addition & 1 deletion common/api-review/analytics.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export interface SettingsOptions {
}

// @public
export function setUserId(analyticsInstance: Analytics, id: string, options?: AnalyticsCallOptions): void;
export function setUserId(analyticsInstance: Analytics, id: string | null, options?: AnalyticsCallOptions): void;

// @public
export function setUserProperties(analyticsInstance: Analytics, properties: CustomParams, options?: AnalyticsCallOptions): void;
Expand Down
6 changes: 3 additions & 3 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"karma-typescript-es6-transform": "5.5.3",
"mocha": "9.2.2",
"typescript": "4.3.4",
"webpack": "5.72.1",
"webpack-cli": "4.9.2",
"webpack-dev-server": "4.9.0"
"webpack": "5.74.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.10.0"
}
}
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@
"@babel/preset-env": "7.17.10",
"@babel/register": "7.17.7",
"@babel/preset-typescript": "7.16.7",
"babel-plugin-transform-import-meta": "2.1.1",
"@changesets/changelog-github": "0.4.4",
"@changesets/cli": "2.22.0",
"@changesets/changelog-github": "0.4.7",
"@changesets/cli": "2.25.0",
"@types/chai": "4.3.1",
"@types/chai-as-promised": "7.1.5",
"@types/child-process-promise": "2.2.2",
Expand Down Expand Up @@ -108,8 +107,8 @@
"find-free-port": "2.0.0",
"firebase-functions": "3.22.0",
"firebase-tools": "11.2.2",
"glob": "7.2.0",
"http-server": "14.1.0",
"glob": "7.2.3",
"http-server": "14.1.1",
"indexeddbshim": "8.0.0",
"inquirer": "8.2.4",
"istanbul-instrumenter-loader": "3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function setCurrentScreen(
*/
export function setUserId(
analyticsInstance: Analytics,
id: string,
id: string | null,
options?: AnalyticsCallOptions
): void {
analyticsInstance = getModularInstance(analyticsInstance);
Expand Down
21 changes: 21 additions & 0 deletions packages/analytics/src/functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ describe('FirebaseAnalytics methods', () => {
});
});

it('setUserId() with null (user) id calls gtag correctly (instance)', async () => {
await setUserId(gtagStub, fakeInitializationPromise, null);
expect(gtagStub).to.have.been.calledWith(
GtagCommand.CONFIG,
fakeMeasurementId,
{
'user_id': null,
update: true
}
);
});

it('setUserId() calls gtag correctly (instance)', async () => {
await setUserId(gtagStub, fakeInitializationPromise, 'user123');
expect(gtagStub).to.have.been.calledWith(
Expand All @@ -137,6 +149,15 @@ describe('FirebaseAnalytics methods', () => {
});
});

it('setUserId() with null (user) id calls gtag correctly (global)', async () => {
await setUserId(gtagStub, fakeInitializationPromise, null, {
global: true
});
expect(gtagStub).to.be.calledWith(GtagCommand.SET, {
'user_id': null
});
});

it('setUserProperties() calls gtag correctly (instance)', async () => {
await setUserProperties(gtagStub, fakeInitializationPromise, {
'currency': 'USD',
Expand Down
4 changes: 4 additions & 0 deletions packages/database/src/core/SyncTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export interface ListenProvider {
*/
let syncTreeNextQueryTag_ = 1;

export function resetSyncTreeTag() {
syncTreeNextQueryTag_ = 1;
}

/**
* SyncTree is the central class for managing event callback registration, data caching, views
* (query processing), and event generation. There are typically two SyncTree instances for
Expand Down
Loading

0 comments on commit 6d4e08a

Please sign in to comment.