-
Notifications
You must be signed in to change notification settings - Fork 616
Implementing retry once for FIS Client. #895
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
@@ -53,8 +55,6 @@ | |||
private static final String CONTENT_ENCODING_HEADER_KEY = "Content-Encoding"; | |||
private static final String GZIP_CONTENT_ENCODING = "gzip"; | |||
|
|||
private static final String UNAUTHORIZED_ERROR_MESSAGE = | |||
"The request did not have the required credentials."; | |||
private static final String INTERNAL_SERVER_ERROR_MESSAGE = "There was an internal server error."; | |||
private static final String NETWORK_ERROR_MESSAGE = "The server returned an unexpected 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.
missing a space between the colon and the error when you concat using +. It would be slightly less error prone to use either a format string here or have a dedicated method for generating these errors (or both)
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. PTAL.
...rc/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java
Outdated
Show resolved
Hide resolved
httpsURLConnection.addRequestProperty(CONTENT_TYPE_HEADER_KEY, JSON_CONTENT_TYPE); | ||
httpsURLConnection.addRequestProperty(ACCEPT_HEADER_KEY, JSON_CONTENT_TYPE); | ||
httpsURLConnection.addRequestProperty(CONTENT_ENCODING_HEADER_KEY, GZIP_CONTENT_ENCODING); | ||
HttpsURLConnection httpsURLConnection = (HttpsURLConnection) url.openConnection(); |
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.
there's a lot of overlap between this method and the other one that sets up a POST request. Can we maybe consolidate some of the shared logic?
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.
Done.
...rc/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java
Show resolved
Hide resolved
* Simplifying FirebaseInstallations class by adding listeners. * Addressing ciaran's comments to return same token if multiple getAuthToken() calls are triggered simultaneously. * Cleaning doRegistration method. * Fixing FISClient to correctly parse expiration timestamp. (#848) * Updating getAuthToken to return creation timestamp (#884) * Propagating the exceptions to the clients. (#856)
/retest |
throw new FirebaseInstallationServiceException( | ||
NETWORK_ERROR_MESSAGE + e.getMessage(), | ||
FirebaseInstallationServiceException.Status.NETWORK_ERROR); | ||
throw new FirebaseException(String.format(NETWORK_ERROR_MESSAGE, e.getMessage())); |
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.
does it make sense to embed the IOException as a cause?
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.
IOException wraps many exceptions : MalformedException, ProtocolException, UnknownServiceException etc. My reasoning to add this as a cause for users to know what went wrong and handle accordingly.
...rc/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java
Show resolved
Hide resolved
/retest |
/test new-smoke-tests |
1 similar comment
/test new-smoke-tests |
/retest |
/test new-smoke-tests |
* Fixing FISClient to correctly parse expiration timestamp. (#848) * Updating getAuthToken to return creation timestamp (#884) * Propagating the exceptions to the clients. (#856) * Extract FID from FIS createInstallation response (#888) * Addressing Rayo's comment: Rename PersistedFidEntry to (#899) * Implementing retry once for FIS Client. (#895) * Simplifying FirebaseInstallations class by adding listeners. (#847) * Fixing FISClient to correctly parse expiration timestamp. (#848) * Updating getAuthToken to return creation timestamp (#884) * Propagating the exceptions to the clients. (#856)
No description provided.