Skip to content

Commit d6202b9

Browse files
Merge master into release
2 parents e8ff8b8 + ac10cc3 commit d6202b9

File tree

9 files changed

+46
-65
lines changed

9 files changed

+46
-65
lines changed

.changeset/shiny-houses-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/app-check': patch
3+
---
4+
5+
Prevent App Check from logging "uncaught" cancelled promises. The cancelled promises are part of App Check's expected behavior, and their cancellation wasn't intended to produce errors or warnings. See issue #7805.

.changeset/tiny-lobsters-own.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+
Protection from enumerating an empty list in Auth's reading of IndexedDB results, as this causes errors in some macOS and iOS browser runtimes.

.changeset/wet-moons-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/database': patch
3+
---
4+
5+
Add `@firebase/app-check-interop-types` dependency to `database` package

packages/app-check/src/proactive-refresh.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ export class Refresher {
6464
this.stop();
6565
try {
6666
this.pending = new Deferred();
67+
this.pending.promise.catch(_e => {
68+
/* ignore */
69+
});
6770
await sleep(this.getNextRun(hasSucceeded));
6871

6972
// Why do we resolve a promise, then immediate wait for it?
@@ -74,6 +77,9 @@ export class Refresher {
7477
this.pending.resolve();
7578
await this.pending.promise;
7679
this.pending = new Deferred();
80+
this.pending.promise.catch(_e => {
81+
/* ignore */
82+
});
7783
await this.operation();
7884

7985
this.pending.resolve();

packages/auth/src/platform_browser/persistence/indexed_db.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,16 @@ class IndexedDBLocalPersistence implements InternalPersistence {
369369

370370
const keys = [];
371371
const keysInResult = new Set();
372-
for (const { fbase_key: key, value } of result) {
373-
keysInResult.add(key);
374-
if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {
375-
this.notifyListeners(key, value as PersistenceValue);
376-
keys.push(key);
372+
if (result.length !== 0) {
373+
for (const { fbase_key: key, value } of result) {
374+
keysInResult.add(key);
375+
if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {
376+
this.notifyListeners(key, value as PersistenceValue);
377+
keys.push(key);
378+
}
377379
}
378380
}
381+
379382
for (const localKey of Object.keys(this.localCache)) {
380383
if (this.localCache[localKey] && !keysInResult.has(localKey)) {
381384
// Deleted

packages/auth/test/integration/webdriver/compat/firebaseui.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ browserDescribe('WebDriver integration with FirebaseUI', driver => {
5151
expect(snap.uid).to.be.a('string');
5252
});
5353

54-
it('allows google redirect sign in', async function () {
55-
// Test is ignored for now as it fails.
56-
// TODO: Investigate and unskip the test.
57-
this.skip();
58-
54+
it('allows google redirect sign in', async () => {
5955
const page = await startUi();
6056
await page.clickGoogleSignIn();
6157
const widget = new IdPPage(driver.webDriver);

packages/auth/test/integration/webdriver/redirect.test.ts

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
4848
await driver.start('chrome');
4949
});
5050

51-
it('allows users to sign in', async function () {
52-
// Test is ignored for now as it fails.
53-
// TODO: Investigate and unskip the test.
54-
this.skip();
55-
51+
it('allows users to sign in', async () => {
5652
await driver.callNoWait(RedirectFunction.IDP_REDIRECT);
5753
const widget = new IdPPage(driver.webDriver);
5854

@@ -84,10 +80,6 @@ browserDescribe('WebDriver redirect IdP test', driver => {
8480

8581
// Redirect works with middleware for now
8682
it('is blocked by middleware', async function () {
87-
// Test is ignored for now as it fails.
88-
// TODO: Investigate and unskip the test.
89-
this.skip();
90-
9183
if (driver.isCompatLayer()) {
9284
console.warn('Skipping middleware tests in compat');
9385
this.skip();
@@ -114,11 +106,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
114106
expect(await driver.getUserSnapshot()).to.be.null;
115107
});
116108

117-
it('can link with another account account', async function () {
118-
// Test is ignored for now as it fails.
119-
// TODO: Investigate and unskip the test.
120-
this.skip();
121-
109+
it('can link with another account account', async () => {
122110
// First, sign in anonymously
123111
const { user: anonUser }: UserCredential = await driver.call(
124112
AnonFunction.SIGN_IN_ANONYMOUSLY
@@ -140,11 +128,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
140128
expect(user.email).to.eq('bob@bob.test');
141129
});
142130

143-
it('can be converted to a credential', async function () {
144-
// Test is ignored for now as it fails.
145-
// TODO: Investigate and unskip the test.
146-
this.skip();
147-
131+
it('can be converted to a credential', async () => {
148132
// Start with redirect
149133
await driver.callNoWait(RedirectFunction.IDP_REDIRECT);
150134
const widget = new IdPPage(driver.webDriver);
@@ -172,11 +156,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
172156
expect(second.providerData).to.eql(first.providerData);
173157
});
174158

175-
it('handles account exists different credential errors', async function () {
176-
// Test is ignored for now as it fails.
177-
// TODO: Investigate and unskip the test.
178-
this.skip();
179-
159+
it('handles account exists different credential errors', async () => {
180160
// Start with redirect and a verified account
181161
await driver.callNoWait(RedirectFunction.IDP_REDIRECT);
182162
const widget = new IdPPage(driver.webDriver);
@@ -211,11 +191,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
211191
]);
212192
});
213193

214-
it('does not auto-upgrade anon accounts', async function () {
215-
// Test is ignored for now as it fails.
216-
// TODO: Investigate and unskip the test.
217-
this.skip();
218-
194+
it('does not auto-upgrade anon accounts', async () => {
219195
const { user: anonUser }: UserCredential = await driver.call(
220196
AnonFunction.SIGN_IN_ANONYMOUSLY
221197
);
@@ -232,11 +208,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
232208
expect(curUser.uid).not.to.eq(anonUser.uid);
233209
});
234210

235-
it('linking with anonymous user upgrades account', async function () {
236-
// Test is ignored for now as it fails.
237-
// TODO: Investigate and unskip the test.
238-
this.skip();
239-
211+
it('linking with anonymous user upgrades account', async () => {
240212
const { user: anonUser }: UserCredential = await driver.call(
241213
AnonFunction.SIGN_IN_ANONYMOUSLY
242214
);
@@ -254,11 +226,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
254226
expect(curUser.isAnonymous).to.be.false;
255227
});
256228

257-
it('is possible to link with different email', async function () {
258-
// Test is ignored for now as it fails.
259-
// TODO: Investigate and unskip the test.
260-
this.skip();
261-
229+
it('is possible to link with different email', async () => {
262230
const { user: emailUser }: UserCredential = await driver.call(
263231
EmailFunction.CREATE_USER,
264232
'user@test.test'
@@ -281,11 +249,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
281249
expect(curUser.providerData.length).to.eq(2);
282250
});
283251

284-
it('is possible to link with the same email', async function () {
285-
// Test is ignored for now as it fails.
286-
// TODO: Investigate and unskip the test.
287-
this.skip();
288-
252+
it('is possible to link with the same email', async () => {
289253
const { user: emailUser }: UserCredential = await driver.call(
290254
EmailFunction.CREATE_USER,
291255
'same@test.test'
@@ -327,11 +291,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
327291
await driver.call(CoreFunction.SIGN_OUT);
328292
});
329293

330-
it('a user can sign in again', async function () {
331-
// Test is ignored for now as it fails.
332-
// TODO: Investigate and unskip the test.
333-
this.skip();
334-
294+
it('a user can sign in again', async () => {
335295
// Sign in using pre-poulated user
336296
await driver.callNoWait(RedirectFunction.IDP_REDIRECT);
337297

@@ -347,11 +307,7 @@ browserDescribe('WebDriver redirect IdP test', driver => {
347307
expect(user.email).to.eq(user1.email);
348308
});
349309

350-
it('reauthenticate works for the correct user', async function () {
351-
// Test is ignored for now as it fails.
352-
// TODO: Investigate and unskip the test.
353-
this.skip();
354-
310+
it('reauthenticate works for the correct user', async () => {
355311
// Sign in using pre-poulated user
356312
await driver.callNoWait(RedirectFunction.IDP_REDIRECT);
357313

packages/auth/test/integration/webdriver/util/test_server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ class AuthTestServer {
3939
}
4040

4141
get address(): string {
42-
return `http://localhost:${PORT_NUMBER}`;
42+
/*
43+
We use "127.0.0.1" rather than "localhost" since emulator uses the former,
44+
and we want to be on the same origin (to access session storage for redirect-based tests).
45+
*/
46+
return `http://127.0.0.1:${PORT_NUMBER}`;
4347
}
4448

4549
async start(): Promise<void> {

packages/database/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@firebase/logger": "0.4.0",
5353
"@firebase/util": "1.9.3",
5454
"@firebase/component": "0.6.4",
55+
"@firebase/app-check-interop-types": "0.3.0",
5556
"@firebase/auth-interop-types": "0.2.1",
5657
"faye-websocket": "0.11.4",
5758
"tslib": "^2.1.0"

0 commit comments

Comments
 (0)