-
Notifications
You must be signed in to change notification settings - Fork 617
Adding a FidListener that propagates fid changes to the clients. #2195
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
Conversation
Coverage ReportAffected SDKs
Test Logs
NotesHTML coverage reports can be produced locally with Head commit (65007112) is created by Prow via merging commits: 4468726 0e45a10. |
Binary Size ReportAffected SDKs
Test Logs
NotesHead commit (65007112) is created by Prow via merging commits: 4468726 0e45a10. |
...ations-interop/src/main/java/com/google/firebase/installations/FirebaseInstallationsApi.java
Outdated
Show resolved
Hide resolved
...tallations-interop/src/main/java/com/google/firebase/installations/internal/FidListener.java
Outdated
Show resolved
Hide resolved
...ase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java
Outdated
Show resolved
Hide resolved
...ase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java
Outdated
Show resolved
Hide resolved
...ase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java
Outdated
Show resolved
Hide resolved
...ations-interop/src/main/java/com/google/firebase/installations/FirebaseInstallationsApi.java
Show resolved
Hide resolved
...ions-interop/src/main/java/com/google/firebase/installations/internal/HandleFidListener.java
Outdated
Show resolved
Hide resolved
* | ||
* @hide | ||
*/ | ||
void unregister(FidListener fidListener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The handle is supposed to represent a registration so it shouldn't take a listener as a parameter. For an example see
Lines 17 to 25 in c7d3073
/** Represents a listener that can be removed by calling {@link #remove()}. */ | |
public interface ListenerRegistration { | |
/** | |
* Removes the listener being tracked by this {@code ListenerRegistration}. After the initial | |
* call, subsequent calls have no effect. | |
*/ | |
void remove(); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL. Thanks
...ase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java
Outdated
Show resolved
Hide resolved
|
||
FakeFidListener fidListener = new FakeFidListener(); | ||
// Register the FidListener | ||
firebaseInstallations.registerFidListener(fidListener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider adding a test for removing a registration as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this test to check the removing registration code as well. PTAL. Thanks
The public api surface has changed for the subproject firebase-installations: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-installations: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
CI failures look legit, see: https://gist.github.com/vkryachko/d1cd35daaf62a63ff7aff9a94e1a28e4 regarding GuardedBy |
Thanks for pointing this out, Vlad. Fixed it. Just curious: how did you generate this? |
@ankitaj224 No worries, I did not generate it, it was in the build log of the |
fidListeners.remove(fidListener); | ||
public void unregister() { | ||
synchronized (FirebaseInstallations.this) { | ||
if (fidListeners.contains(listener)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: consider removing the contains
check as remove handles it internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Done
@ankitaj224: The following test failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
No description provided.