Skip to content

Commit 788303f

Browse files
Undo debugging changes
1 parent 8c28a96 commit 788303f

File tree

7 files changed

+15
-22
lines changed

7 files changed

+15
-22
lines changed

integration/firestore/firebase_export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function newTestFirestore(
2929
settings?: firebase.firestore.Settings
3030
): firebase.firestore.Firestore {
3131
if (nameOrApp === undefined) {
32-
nameOrApp = 'test-app-minified-' + appCount++;
32+
nameOrApp = 'test-app-' + appCount++;
3333
}
3434
const app =
3535
typeof nameOrApp === 'string'

integration/firestore/firebase_export_memory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function newTestFirestore(
2929
settings?: firebase.firestore.Settings
3030
): firebase.firestore.Firestore {
3131
if (nameOrApp === undefined) {
32-
nameOrApp = 'test-app-minified-memory-' + appCount++;
32+
nameOrApp = 'test-app-' + appCount++;
3333
}
3434
const app =
3535
typeof nameOrApp === 'string'

packages/firestore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"test:exp:browser:debug": "karma start --single-run --exp --auto-watch",
3737
"test": "run-s lint test:all",
3838
"test:ci": "node ../../scripts/run_tests_in_ci.js",
39-
"test:all": "run-s test:browser test:lite:browser test:exp:browser test:travis test:minified",
39+
"test:all": "run-p test:browser test:lite:browser test:exp:browser test:travis test:minified",
4040
"test:browser": "karma start --single-run",
4141
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
4242
"test:node": "node ./scripts/run-tests.js --main=index.node.ts --emulator 'test/{,!(browser)/**/}*.test.ts'",

packages/firestore/src/local/indexeddb_persistence.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import {
7575
SimpleDbTransaction
7676
} from './simple_db';
7777
import { DocumentLike, WindowLike } from '../util/types';
78+
import {ignoreIfPrimaryLeaseLoss} from "./local_store";
7879

7980
const LOG_TAG = 'IndexedDbPersistence';
8081

@@ -680,14 +681,12 @@ export class IndexedDbPersistence implements Persistence {
680681
}
681682
this.detachVisibilityHandler();
682683
this.detachWindowUnloadHook();
683-
if (this.simpleDb.isOpen()) {
684-
await this.runTransaction('shutdown', 'readwrite', txn => {
685-
return this.releasePrimaryLeaseIfHeld(txn).next(() =>
686-
this.removeClientMetadata(txn)
687-
);
688-
});
689-
this.simpleDb.close();
690-
}
684+
await this.runTransaction('shutdown', 'readwrite', txn =>
685+
this.releasePrimaryLeaseIfHeld(txn).next(() =>
686+
this.removeClientMetadata(txn)
687+
)
688+
).catch(e => ignoreIfPrimaryLeaseLoss(e));
689+
this.simpleDb.close();
691690

692691
// Remove the entry marking the client as zombied from LocalStorage since
693692
// we successfully deleted its metadata from IndexedDb.

packages/firestore/src/local/simple_db.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,6 @@ export class SimpleDb {
339339
}
340340
}
341341

342-
isOpen() : boolean {
343-
return !!this.db;
344-
}
345-
346342
close(): void {
347343
if (this.db) {
348344
this.db.close();

packages/firestore/test/integration/util/firebase_export.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ export function newTestFirestore(
6666
nameOrApp?: string | FirebaseApp | FirebaseAppShim,
6767
settings?: firestore.Settings
6868
): firestore.FirebaseFirestore {
69+
if (nameOrApp === undefined) {
70+
nameOrApp = 'test-app-' + appCount++;
71+
}
72+
6973
if (usesFunctionalApi()) {
70-
if (nameOrApp === undefined) {
71-
nameOrApp = 'test-app-exp-' + appCount++;
72-
}
7374
const app =
7475
typeof nameOrApp === 'string'
7576
? initializeApp({ apiKey: 'fake-api-key', projectId }, nameOrApp)
@@ -79,9 +80,6 @@ export function newTestFirestore(
7980
: getFirestore(app);
8081
return new FirestoreShim(firestore);
8182
} else {
82-
if (nameOrApp === undefined) {
83-
nameOrApp = 'test-app-' + appCount++;
84-
}
8583
const app =
8684
typeof nameOrApp === 'string'
8785
? firebase.initializeApp(

packages/firestore/test/unit/util/async_queue.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ describe('AsyncQueue', () => {
396396
queue.enqueueAndForget(() => doStep(1));
397397

398398
// After this call, only operations requested via
399-
// `enqueueAndForgetEvenAfterShutdown` gets executed.
399+
// `enqueueAndForgetEvenWhileRestricted` gets executed.
400400
queue.enterRestrictedMode();
401401
queue.enqueueAndForgetEvenWhileRestricted(() => doStep(2));
402402
queue.enqueueAndForget(() => doStep(3));

0 commit comments

Comments
 (0)