-
Notifications
You must be signed in to change notification settings - Fork 615
Adding Util class for FIrebaseInstallations APIs. #676
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
This reverts commit 2ec4aef.
This reverts commit 7b4ebcf.
This reverts commit 7b4ebcf.
This reverts commit 2ec4aef.
* Adding an interface library for Firebase Installations SDK * Adding Firebase Installations module * Adding Firebase Installations module. * Readding .idea files that were deleted in previous commit * Revert "Adding Firebase Installations module" This reverts commit 2ec4aef. * Revert "Readding .idea files that were deleted in previous commit" This reverts commit 7b4ebcf. * Add firebase installations project path * Adding Firebase Installations module. * Readding .idea files that were deleted in previous commit * Revert "Adding Firebase Installations module" This reverts commit 2ec4aef. * Revert "Readding .idea files that were deleted in previous commit" This reverts commit 7b4ebcf. * Add firebase installations project path * Fixing formattinf issues. * Revert "Adding Firebase Installations module" with hidden files This reverts commit 2ec4aef. * Addressing review comments. * Making InstallationTokenResult an AutoValue class.
This reverts commit 2ec4aef.
This reverts commit 7b4ebcf.
This reverts commit 7b4ebcf.
This reverts commit 2ec4aef.
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.
Looks like this PR contains a lot of code, some of which I'd previously reviewed for @diwu-arete . Can you make a PR that only contains new changes? otherwise the PR is too big and I am not sure which parts to review and which to skip
|
||
public enum Status { | ||
SDK_INTERNAL_ERROR, | ||
|
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.
I suggest to sync with mertcan@ or Rayo about what status we want to expose to dev
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.
@andirayo or @mmermerkaya Whats the high level exception code to be shown to developers in case FIS requests fail? Currently, I have SDK_INTERNAL_ERROR.
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.
I would check with Mertcan's Web-SDK or Maksym's iOS-SDK, but as far as I remember (without checking) I think we are pretty explicit with our error messages.
There are some error messages we receive from the server that our SDK reacts to by resending the same request once. If we can not fix the error, we print a pretty descriptive error message for the developer to be able to understand and fix.
firebase-installations/src/main/java/com/google/firebase/installations/Utils.java
Outdated
Show resolved
Hide resolved
firebase-installations/src/main/java/com/google/firebase/installations/Utils.java
Outdated
Show resolved
Hide resolved
...lations-interop/src/main/java/com/google/firebase/installations/InstallationTokenResult.java
Outdated
Show resolved
Hide resolved
.../androidTest/java/com/google/firebase/installation/FirebaseInstallationInstrumentedTest.java
Outdated
Show resolved
Hide resolved
.../androidTest/java/com/google/firebase/installation/FirebaseInstallationInstrumentedTest.java
Outdated
Show resolved
Hide resolved
...allations/src/main/java/com/google/firebase/installations/FirebaseInstallationException.java
Outdated
Show resolved
Hide resolved
...allations/src/main/java/com/google/firebase/installations/FirebaseInstallationException.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java
Outdated
Show resolved
Hide resolved
@@ -91,16 +91,16 @@ public InstallationResponse createFirebaseInstallation( | |||
return readCreateResponse(httpsURLConnection); | |||
case 401: | |||
throw new FirebaseInstallationServiceException( | |||
UNAUTHORIZED_ERROR_MESSAGE, FirebaseInstallationServiceException.Code.UNAUTHORIZED); | |||
UNAUTHORIZED_ERROR_MESSAGE, FirebaseInstallationServiceException.Status.UNAUTHORIZED); | |||
default: |
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.
Can this ever happen?
How is this a Server-Error?
Seems that this is a client error for not catching all possible error codes.
I think, we should give more information to the developer what is happening here.
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.
Added a TODO in FirebaseInstallationsException class. I will send out another PR for exception handling changes.
...rc/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java
Outdated
Show resolved
Hide resolved
@@ -19,39 +19,38 @@ | |||
|
|||
/** The class for all Exceptions thrown by {@link FirebaseInstallationServiceClient}. */ | |||
public class FirebaseInstallationServiceException extends FirebaseException { | |||
|
|||
public enum Code { | |||
public enum Status { | |||
SERVER_ERROR, | |||
|
|||
NETWORK_ERROR, | |||
|
|||
UNAUTHORIZED |
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.
what about INVALID_ARGUMENT, FORBIDDEN, NOT_FOUND, TOO_MANY_REQUEST?
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.
I will handle this in another PR.
FirebaseApp.initializeApp( | ||
ApplicationProvider.getApplicationContext(), | ||
new FirebaseOptions.Builder().setApplicationId("1:987654321:android:abcdef").build(), | ||
"firebase_app_1"); |
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.
this seems to cover 2 tests in once:
i.e. getting a different instance for a different App-ID, but also getting a different instance for different (nick)name.
Maybe those can be distinguished into 2 separate tests, i.e getting a different instance for different App-ID, and one getting different instance for different (nick)name?
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.
We are not able to create a diff firebase app with different App-ID without a nick-name. As a result, they cant be split in two. On a high level test the instance creation.
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 title for this commit/PR is missing an "s"! haha
firebase-installations/src/main/java/com/google/firebase/installations/Utils.java
Outdated
Show resolved
Hide resolved
firebase-installations/src/main/java/com/google/firebase/installations/Utils.java
Outdated
Show resolved
Hide resolved
firebase-installations/src/main/java/com/google/firebase/installations/Utils.java
Outdated
Show resolved
Hide resolved
Updated. |
* getId() implementation with instrumented tests. * Addressing rayo's comments. - Detailed JavaDocs - Renaming FiidCache as PersistedFid * Addressing rayo's comments. - Detailed JavaDocs - Renaming FiidCache as PersistedFid * Addresing comments to resoleve the following: - Make registerAnsSaveFid non blocking call in getId() - PersistedFidEntry builder with default values * Addressing Ciaran and Rayo's comments. * Addressing Ciaran's comments * Addressing Ciaran's comments * Adding param comments and checking if registration status is valid. * Correcting lint warning: uses-permission should be declared before application in AndroidManifest.xml * Adding custom assertThat with more readable assertions * Correcting instrumented tests to be reliable.
@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. |
* Adding Firebase Installations module * Readding .idea files that were deleted in previous commit * Revert "Adding Firebase Installations module" This reverts commit 2ec4aef. * Revert "Readding .idea files that were deleted in previous commit" This reverts commit 7b4ebcf. * Adding Firebase Installations module. * Readding .idea files that were deleted in previous commit * Revert "Readding .idea files that were deleted in previous commit" This reverts commit 7b4ebcf. * Revert "Adding Firebase Installations module" with hidden files This reverts commit 2ec4aef. * Addressing review comments. * Http client to call FIS backend service. * Http client to call FIS backend service. * Http client to call FIS backend service. * Adding Firebase Installations module * Adding Firebase Installations module. * Readding .idea files that were deleted in previous commit * Readding .idea files that were deleted in previous commit * Revert "Adding Firebase Installations module" This reverts commit 2ec4aef. * Revert "Readding .idea files that were deleted in previous commit" This reverts commit 7b4ebcf. * Revert "Readding .idea files that were deleted in previous commit" This reverts commit 7b4ebcf. * Revert "Adding Firebase Installations module" with hidden files This reverts commit 2ec4aef. * Addressing review comments. * Http client to call FIS backend service. * Http client to call FIS backend service. * Initial Code structure for FIS Android SDK (#648) * Adding an interface library for Firebase Installations SDK * Adding Firebase Installations module * Adding Firebase Installations module. * Readding .idea files that were deleted in previous commit * Revert "Adding Firebase Installations module" This reverts commit 2ec4aef. * Revert "Readding .idea files that were deleted in previous commit" This reverts commit 7b4ebcf. * Add firebase installations project path * Adding Firebase Installations module. * Readding .idea files that were deleted in previous commit * Revert "Adding Firebase Installations module" This reverts commit 2ec4aef. * Revert "Readding .idea files that were deleted in previous commit" This reverts commit 7b4ebcf. * Add firebase installations project path * Fixing formattinf issues. * Revert "Adding Firebase Installations module" with hidden files This reverts commit 2ec4aef. * Addressing review comments. * Making InstallationTokenResult an AutoValue class. * Http client to call FIS backend service. * Addresing comments and introducing new FirebaseInstallationService Exception. * Implementing getId method in FirebaseInstallation to call backend. * 1. Adding instrumentation tests. 2. Introducing serviceClient level and main class exceptions. * Addressing Di's comments. * Addressing Rayo's comments * Updating parameters order in ServiceClient. * Updating createRandomFid as per Rayo's comments. * getId() implementation with instrumented tests. (#703) * getId() implementation with instrumented tests. * Addressing rayo's comments. - Detailed JavaDocs - Renaming FiidCache as PersistedFid * Addressing rayo's comments. - Detailed JavaDocs - Renaming FiidCache as PersistedFid * Addresing comments to resoleve the following: - Make registerAnsSaveFid non blocking call in getId() - PersistedFidEntry builder with default values * Addressing Ciaran and Rayo's comments. * Addressing Ciaran's comments * Addressing Ciaran's comments * Adding param comments and checking if registration status is valid. * Correcting lint warning: uses-permission should be declared before application in AndroidManifest.xml * Adding custom assertThat with more readable assertions * Correcting instrumented tests to be reliable.
No description provided.