Skip to content

Instantly share code, notes, and snippets.

View schmidt-sebastian's full-sized avatar

Sebastian Schmidt schmidt-sebastian

  • San Francisco, CA
View GitHub Profile
diff --git a/dev/src/bulk-writer.ts b/dev/src/bulk-writer.ts
index e4f4ca7..fea0994 100644
--- a/dev/src/bulk-writer.ts
+++ b/dev/src/bulk-writer.ts
@@ -276,9 +276,6 @@ class BulkCommitBatch {
const stack = Error().stack!;
let results: BatchWriteResult[] = [];
- for (let attempt = 0; attempt < MAX_RETRY_ATTEMPTS; attempt++) {
- await this.backoff.backoffAndWait();
diff --git a/dev/src/bulk-writer.ts b/dev/src/bulk-writer.ts
index e4f4ca7..cf2e930 100644
--- a/dev/src/bulk-writer.ts
+++ b/dev/src/bulk-writer.ts
@@ -40,9 +40,6 @@ import {
validateInteger,
validateOptional,
} from './validate';
-// TODO: How do I get rid of this?
-// eslint-disable-next-line no-undef
diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts
index 0a974f6be..59cc873d3 100644
--- a/packages/database/src/api/Database.ts
+++ b/packages/database/src/api/Database.ts
@@ -105,11 +105,11 @@ export class Database implements FirebaseService {
const apiName = 'database.refFromURL';
this.checkDeleted_(apiName);
validateArgCount(apiName, 1, 1, arguments.length);
- const parsedURL = parseRepoInfo(url);
+ const parsedURL = parseRepoInfo(url, this.repo_.repoInfo_.nodeAdmin);
diff --git a/packages/firestore/src/core/bundle.ts b/packages/firestore/src/core/bundle.ts
index adba7f725..90dd394fe 100644
--- a/packages/firestore/src/core/bundle.ts
+++ b/packages/firestore/src/core/bundle.ts
@@ -83,7 +83,7 @@ export type BundledDocuments = BundledDocument[];
* Helper to convert objects from bundles to model objects in the SDK.
*/
export class BundleConverter {
- constructor(private serializer: JsonProtoSerializer) {}
+ constructor(private readonly serializer: JsonProtoSerializer) {}
const doc = firestore('doc/a');
runTransaction(await t => {
t.get();
// Note: This is bad practice, but here we update `doc` inside of the transaciton
// but not using the transaction API. This update will fail with ABORTED.
await doc.set({});
})
diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java
index c15cb67..99ff684 100644
--- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java
+++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java
@@ -64,7 +64,7 @@ public abstract class UpdateBuilder<T> {
}
final FirestoreImpl firestore;
- private final List<WriteOperation> writes;
+ protected final List<WriteOperation> writes;
diff --git a/packages/firestore/src/core/bundle.ts b/packages/firestore/src/core/bundle.ts
index b43853c8e..087f869d6 100644
--- a/packages/firestore/src/core/bundle.ts
+++ b/packages/firestore/src/core/bundle.ts
@@ -67,7 +67,7 @@ export interface NamedQuery {
*/
interface BundledDocument {
metadata: bundleProto.BundledDocumentMetadata;
- document: api.Document | undefined;
+ document?: api.Document;
diff --git a/packages/firestore/src/api/bundle.ts b/packages/firestore/src/api/bundle.ts
index c02f267d4..9f8df58c1 100644
--- a/packages/firestore/src/api/bundle.ts
+++ b/packages/firestore/src/api/bundle.ts
@@ -18,7 +18,7 @@
import * as firestore from '@firebase/firestore-types';
import { Deferred } from '../util/promise';
-export class LoadBundleTask implements firestore.LoadBundleTask {
+export class LoadBundleTask implements firestore.LoadBundleTask, PromiseLike<firestore.LoadBundleTaskProgress> {
diff --git a/dev/src/bulk-writer.ts b/dev/src/bulk-writer.ts
index ee09c4c..5792274 100644
--- a/dev/src/bulk-writer.ts
+++ b/dev/src/bulk-writer.ts
@@ -82,15 +82,12 @@ class BulkCommitBatch {
*/
state = BatchState.OPEN;
- // The set of document reference paths present in the WriteBatch.
- readonly docPaths = new Set<string>();
diff --git a/firebase-database/src/main/java/com/google/firebase/database/core/utilities/Utilities.java b/firebase-database/src/main/java/com/google/firebase/database/core/utilities/Utilities.java
index 50299dc3..bdf49cdd 100644
--- a/firebase-database/src/main/java/com/google/firebase/database/core/utilities/Utilities.java
+++ b/firebase-database/src/main/java/com/google/firebase/database/core/utilities/Utilities.java
@@ -54,26 +54,32 @@ public class Utilities {
throw new IllegalArgumentException("Database URL does not specify a valid host");
}
- RepoInfo repoInfo = new RepoInfo();
- repoInfo.host = host.toLowerCase();