Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot listener source from cache #5690

Merged
merged 37 commits into from Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2e42dcc
add event manager changes
milaGGL Feb 1, 2024
2b703da
add integration tests
milaGGL Feb 2, 2024
5df9ad3
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 2, 2024
78f3569
add transaction tests
milaGGL Feb 2, 2024
f2073fb
port spec tests from web
milaGGL Feb 5, 2024
616ce9e
Update api.txt
milaGGL Feb 5, 2024
eb689e9
Update CHANGELOG.md
milaGGL Feb 5, 2024
3c5b3e1
move source identifier function to QueryListener class
milaGGL Feb 6, 2024
04aea08
remove log
milaGGL Feb 7, 2024
a6d2d16
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 8, 2024
d44d930
extract option builder functions
milaGGL Feb 9, 2024
6a0e099
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 12, 2024
7dd3421
format
milaGGL Feb 12, 2024
5bace7e
Update SnapshotListenerSourceTest.java
milaGGL Feb 12, 2024
4c174ab
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 12, 2024
21f5244
format
milaGGL Feb 12, 2024
803bfe7
Merge branch 'mila/snapshot-listener-from-cache' of https://github.co…
milaGGL Feb 12, 2024
1f72c22
port changes in Web sdk
milaGGL Feb 14, 2024
a5edd41
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 14, 2024
6ea62b4
Update EventManager.java
milaGGL Feb 14, 2024
048db99
resolve comments
milaGGL Feb 15, 2024
d599508
Update api.txt
milaGGL Feb 15, 2024
a1ea0ec
Update EventManagerTest.java
milaGGL Feb 15, 2024
a58878b
Update SnapshotListenOptions.java
milaGGL Feb 15, 2024
92126f8
format
milaGGL Feb 15, 2024
29b07da
Update api.txt
milaGGL Feb 15, 2024
a90c187
Update firebase-firestore/src/main/java/com/google/firebase/firestore…
milaGGL Feb 16, 2024
1a35d96
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 20, 2024
cc002c5
resolve comments
milaGGL Feb 20, 2024
b3a94be
Merge branch 'mila/snapshot-listener-from-cache' of https://github.co…
milaGGL Feb 20, 2024
a23f446
Update CHANGELOG.md
milaGGL Feb 20, 2024
d91e191
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 20, 2024
ef00a03
resolve comments
milaGGL Feb 20, 2024
877e4ca
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 20, 2024
ebfd63a
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Feb 22, 2024
7d592e1
Merge branch 'master' into mila/snapshot-listener-from-cache
milaGGL Mar 4, 2024
668a4cb
update spec tests
milaGGL Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion firebase-firestore/CHANGELOG.md
@@ -1,5 +1,5 @@
# Unreleased

* [feature] Enable snapshot listener option to retrieve data from local cache only. [#5690](//github.com/firebase/firebase-android-sdk/pull/5690)

# 24.10.3
* [fixed] Fixed the missing handling setter annotations bug introduced by [#5626](//github.com/firebase/firebase-android-sdk/pull/5626). [#5706](//github.com/firebase/firebase-android-sdk/pull/5706)
Expand Down
23 changes: 23 additions & 0 deletions firebase-firestore/api.txt
Expand Up @@ -97,6 +97,7 @@ package com.google.firebase.firestore {
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.DocumentSnapshot>);
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull java.util.concurrent.Executor, @NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.DocumentSnapshot>);
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull android.app.Activity, @NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.DocumentSnapshot>);
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull com.google.firebase.firestore.SnapshotListenOptions, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.DocumentSnapshot>);
method @NonNull public com.google.firebase.firestore.CollectionReference collection(@NonNull String);
method @NonNull public com.google.android.gms.tasks.Task<java.lang.Void> delete();
method @NonNull public com.google.android.gms.tasks.Task<com.google.firebase.firestore.DocumentSnapshot> get();
Expand Down Expand Up @@ -318,6 +319,11 @@ package com.google.firebase.firestore {
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface IgnoreExtraProperties {
}

public enum ListenSource {
enum_constant public static final com.google.firebase.firestore.ListenSource CACHE;
enum_constant public static final com.google.firebase.firestore.ListenSource DEFAULT;
}

public interface ListenerRegistration {
method public void remove();
}
Expand Down Expand Up @@ -437,6 +443,7 @@ package com.google.firebase.firestore {
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>);
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull java.util.concurrent.Executor, @NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>);
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull android.app.Activity, @NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>);
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull com.google.firebase.firestore.SnapshotListenOptions, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>);
method @NonNull public com.google.firebase.firestore.AggregateQuery aggregate(@NonNull com.google.firebase.firestore.AggregateField, @NonNull com.google.firebase.firestore.AggregateField...);
method @NonNull public com.google.firebase.firestore.AggregateQuery count();
method @NonNull public com.google.firebase.firestore.Query endAt(@NonNull com.google.firebase.firestore.DocumentSnapshot);
Expand Down Expand Up @@ -510,6 +517,22 @@ package com.google.firebase.firestore {
method @NonNull public static com.google.firebase.firestore.SetOptions mergeFields(java.lang.String...);
}

public final class SnapshotListenOptions {
method @Nullable public android.app.Activity getActivity();
method @NonNull public java.util.concurrent.Executor getExecutor();
method @NonNull public com.google.firebase.firestore.MetadataChanges getMetadataChanges();
method @NonNull public com.google.firebase.firestore.ListenSource getSource();
}

public static class SnapshotListenOptions.Builder {
ctor public SnapshotListenOptions.Builder();
method @NonNull public com.google.firebase.firestore.SnapshotListenOptions build();
method @NonNull public com.google.firebase.firestore.SnapshotListenOptions.Builder setActivity(@NonNull android.app.Activity);
method @NonNull public com.google.firebase.firestore.SnapshotListenOptions.Builder setExecutor(@NonNull java.util.concurrent.Executor);
method @NonNull public com.google.firebase.firestore.SnapshotListenOptions.Builder setMetadataChanges(@NonNull com.google.firebase.firestore.MetadataChanges);
method @NonNull public com.google.firebase.firestore.SnapshotListenOptions.Builder setSource(@NonNull com.google.firebase.firestore.ListenSource);
}

public class SnapshotMetadata {
method public boolean hasPendingWrites();
method public boolean isFromCache();
Expand Down