Skip to content

Commit 465e8df

Browse files
committed
Merge remote-tracking branch 'origin/master' into mila/BloomFilter
2 parents a4ee560 + 2e22d5b commit 465e8df

File tree

8 files changed

+38
-10
lines changed

8 files changed

+38
-10
lines changed

.changeset/chilled-buckets-sneeze.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/firestore': patch
3+
'firebase': patch
4+
---
5+
6+
Check navigator.userAgent, in addition to navigator.appVersion, when determining whether to work around an IndexedDb bug in Safari.

.changeset/fluffy-seas-behave.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/auth": patch
3+
---
4+
5+
Explicitly set createdAt and lastLoginAt when cloning UserImpl

packages/auth/demo/README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,22 @@ The demo page by default runs against the actual Auth Backend. To run against th
9090
yarn run demo:emulator
9191
```
9292

93+
## Running against Auth Staging endpoint
94+
95+
Modify the configured endpoint to staging by following the changes in this branch:
96+
97+
https://github.com/firebase/firebase-js-sdk/compare/use-staging
98+
9399
## Running against local changes to auth package
94100

95-
By default, the demo runs against the latest release of firebase-auth sdk. This can be modified by:
101+
102+
By default, the demo runs against the local firebase-auth implementation in packages/auth/src.
103+
This can be modified to point to a released version using:
96104

97105
```
98106
// packages/auth/demo/package.json
99-
+ "@firebase/auth": "file:..",
100-
- "@firebase/auth": "0.18.0",
107+
- "@firebase/auth": "file:..",
108+
+ "@firebase/auth": "0.18.0",
101109
```
102110

103111
## Troubleshooting

packages/auth/demo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"dependencies": {
2020
"@firebase/app": "0.7.24",
21-
"@firebase/auth": "0.20.1",
21+
"@firebase/auth": "file:..",
2222
"@firebase/logger": "0.3.2",
2323
"@firebase/util": "1.6.0",
2424
"tslib": "^2.1.0"

packages/auth/src/core/user/user_impl.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ describe('core/user/user_impl', () => {
274274
uid: 'i-am-uid'
275275
}
276276
],
277-
tenantId: 'tenant-id'
277+
tenantId: 'tenant-id',
278+
createdAt: '2018-01-01 13:02:56.12345678',
279+
lastLoginAt: '2018-01-05 13:02:56.12345678'
278280
});
279281

280282
const newAuth = await testAuth();
@@ -294,6 +296,7 @@ describe('core/user/user_impl', () => {
294296
uid: 'i-am-uid'
295297
}
296298
]);
299+
expect(copy.metadata.toJSON()).to.eql(user.metadata.toJSON());
297300
});
298301
});
299302
});

packages/auth/src/core/user/user_impl.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,13 @@ export class UserImpl implements UserInternal {
140140
}
141141

142142
_clone(auth: AuthInternal): UserInternal {
143-
return new UserImpl({
143+
const newUser = new UserImpl({
144144
...this,
145145
auth,
146146
stsTokenManager: this.stsTokenManager._clone()
147147
});
148+
newUser.metadata._copy(this.metadata);
149+
return newUser;
148150
}
149151

150152
_onReload(callback: NextFn<APIUserInfo>): void {

packages/firestore-compat/test/fields.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ apiDescribe('Timestamp Fields in snapshots', (persistence: boolean) => {
387387
});
388388

389389
apiDescribe('`undefined` properties', (persistence: boolean) => {
390-
const settings = { ...DEFAULT_SETTINGS };
391-
settings.ignoreUndefinedProperties = true;
390+
const settings = { ...DEFAULT_SETTINGS, ignoreUndefinedProperties: true };
392391

393392
it('are ignored in set()', () => {
394393
return withTestDocAndSettings(persistence, settings, async doc => {

packages/firestore/src/local/indexeddb_persistence.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,13 @@ export class IndexedDbPersistence implements Persistence {
977977
// to make sure it gets a chance to run.
978978
this.markClientZombied();
979979

980-
if (isSafari() && navigator.appVersion.match(/Version\/1[45]/)) {
981-
// On Safari 14 and 15, we do not run any cleanup actions as it might
980+
const safariIndexdbBugVersionRegex = /(?:Version|Mobile)\/1[456]/;
981+
if (
982+
isSafari() &&
983+
(navigator.appVersion.match(safariIndexdbBugVersionRegex) ||
984+
navigator.userAgent.match(safariIndexdbBugVersionRegex))
985+
) {
986+
// On Safari 14, 15, and 16, we do not run any cleanup actions as it might
982987
// trigger a bug that prevents Safari from re-opening IndexedDB during
983988
// the next page load.
984989
// See https://bugs.webkit.org/show_bug.cgi?id=226547

0 commit comments

Comments
 (0)