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/firebase-firestore/ktx/src/test/java/com/google/firebase/firestore/TestUtil.java b/firebase-firestore/ktx/src/test/java/com/google/firebase/firestore/TestUtil.java
index 96ea2288..d2ec7b47 100644
--- a/firebase-firestore/ktx/src/test/java/com/google/firebase/firestore/TestUtil.java
+++ b/firebase-firestore/ktx/src/test/java/com/google/firebase/firestore/TestUtil.java
@@ -117,7 +117,8 @@ public class TestUtil {
documentChanges,
isFromCache,
mutatedKeys,
- true,
+ /* synced= */ false,
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.google.firebase.firestore.core;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.google.android.gms.tasks.Task;
diff --git a/dev/src/reference.ts b/dev/src/reference.ts
index afe71bd..de7a49e 100644
--- a/dev/src/reference.ts
+++ b/dev/src/reference.ts
@@ -941,10 +941,11 @@ interface QueryCursor {
* These options are immutable. Modified options can be created using `with()`.
* @private
*/
-export class QueryOptions {
+export class QueryOptions<T> {
diff --git a/dev/src/reference.ts b/dev/src/reference.ts
index afe71bd..7142bd5 100644
--- a/dev/src/reference.ts
+++ b/dev/src/reference.ts
@@ -1700,17 +1700,7 @@ export class Query<T = DocumentData> {
.on('data', result => {
readTime = result.readTime;
if (result.document) {
- const document: QueryDocumentSnapshot<T> = result.document;
- const finalDoc = new DocumentSnapshotBuilder(
> Task :app:dependencies
------------------------------------------------------------
Project :app
------------------------------------------------------------
androidApis - Configuration providing various types of Android JAR file
No dependencies
Previously, Firestore returned timestamp fields as `Date` but `Date`
only supports millisecond precision, which leads to truncation and
causes unexpected behavior when using a timestamp from a snapshot as a
part of a subsequent query.
Now, Firestore returns `Timestamp` values for all timestamp values stored
Cloud Firestore instead of system `Date` objects, avoiding this kind of
problem. Consequently, you must now update your code to handle `Timestamp`
objects instead of `Date` objects.
@schmidt-sebastian
schmidt-sebastian / gist:27d45b5968bafbd325cf212882c8d599
Last active April 2, 2020 20:22
Convert Firestore timestamps to Dates
Previously, Firestore returned timestamp fields as `Date` but `Date`
only supports millisecond precision, which leads to truncation and
causes unexpected behavior when using a timestamp from a snapshot as a
part of a subsequent query.
Now, Firestore returns `Timestamp` values for all timestamp values stored
Cloud Firestore instead of system `Date` objects, avoiding this kind of
problem. Consequently, you must now update your code to handle `Timestamp`
objects instead of `Date` objects.
Previously, Firestore returned timestamp fields as `Date` but `Date`
only supports millisecond precision, which leads to truncation and
causes unexpected behavior when using a timestamp from a snapshot as a
part of a subsequent query.
Now, Firestore returns `Timestamp` values for all timestamp values stored
in Cloud Firestore instead of system `Date` objects, avoiding this kind of
problem. Consequently, you must now update your code to handle `Timestamp`
objects instead of `Date` objects.
diff --git a/dev/test/bulk-writer.ts b/dev/test/bulk-writer.ts
index 7dcb919..362fb5f 100644
--- a/dev/test/bulk-writer.ts
+++ b/dev/test/bulk-writer.ts
@@ -39,18 +39,9 @@ setLogFunction(() => {});
const PROJECT_ID = 'test-project';
-interface BulkWriterRequest {
- writes: api.IWrite[] | null;
diff --git a/dev/test/bulk-writer.ts b/dev/test/bulk-writer.ts
index 182eaa5..c096082 100644
--- a/dev/test/bulk-writer.ts
+++ b/dev/test/bulk-writer.ts
@@ -131,17 +131,13 @@ describe('BulkWriter', () => {
* /**
* Creates an instance with the mocked objects.
*
- * @param options.enforceSingleConcurrentRequest Whether to check that there
+ * @param enforceSingleConcurrentRequest Whether to check that there