Skip to content

Replace old realtime exceptions with new exceptions #4304

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

Merged
merged 7 commits into from
Nov 17, 2022

Conversation

qdpham13
Copy link
Contributor

Update Realtime exceptions to the ones specified in this doc: go/realtime-rc-sdk-exceptions

@google-oss-bot
Copy link
Contributor

1 Warning
⚠️ Did you forget to add a changelog entry? (Add the 'no-changelog' label to the PR to silence this warning.)

Generated by 🚫 Danger

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 10, 2022

Coverage Report 1

Affected Products

  • firebase-config

    Overall coverage changed from ? (290a487) to 80.22% (bb55c49) by ?.

    28 individual files with coverage change

    FilenameBase (290a487)Merge (bb55c49)Diff
    Code.java?0.00%?
    ConfigAutoFetch.java?88.24%?
    ConfigCacheClient.java?93.33%?
    ConfigContainer.java?93.06%?
    ConfigFetchHandler.java?96.69%?
    ConfigFetchHttpClient.java?86.21%?
    ConfigGetParameterHandler.java?96.45%?
    ConfigMetadataClient.java?90.63%?
    ConfigRealtimeHandler.java?21.57%?
    ConfigRealtimeHttpClient.java?33.82%?
    ConfigStorageClient.java?100.00%?
    ConfigUpdateListener.java?0.00%?
    ConfigUpdateListenerRegistration.java?0.00%?
    DefaultsXmlParser.java?0.00%?
    FirebaseRemoteConfig.java?87.83%?
    FirebaseRemoteConfigClientException.java?75.00%?
    FirebaseRemoteConfigException.java?95.65%?
    FirebaseRemoteConfigFetchThrottledException.java?100.00%?
    FirebaseRemoteConfigInfo.java?0.00%?
    FirebaseRemoteConfigInfoImpl.java?100.00%?
    FirebaseRemoteConfigServerException.java?84.21%?
    FirebaseRemoteConfigSettings.java?61.54%?
    FirebaseRemoteConfigValue.java?0.00%?
    FirebaseRemoteConfigValueImpl.java?84.62%?
    Personalization.java?91.43%?
    RemoteConfigComponent.java?84.71%?
    RemoteConfigConstants.java?0.00%?
    RemoteConfigRegistrar.java?100.00%?

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/Hn37tAfDf8.html

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-config:
error: Removed method com.google.firebase.remoteconfig.ConfigUpdateListener.onError(Exception) [RemovedMethod]
error: Added method com.google.firebase.remoteconfig.ConfigUpdateListener.onError(com.google.firebase.remoteconfig.FirebaseRemoteConfigException) [AddedAbstractMethod]
error: Removed class com.google.firebase.remoteconfig.FirebaseRemoteConfigRealtimeUpdateFetchException [RemovedClass]
error: Removed class com.google.firebase.remoteconfig.FirebaseRemoteConfigRealtimeUpdateStreamException [RemovedClass]

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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2022

Unit Test Results

1 225 tests  ±0   1 225 ✔️ ±0   2m 21s ⏱️ +28s
     62 suites ±0          0 💤 ±0 
     62 files   ±0          0 ±0 

Results for commit e2894dc. ± Comparison against base commit 290a487.

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 10, 2022

Size Report 1

Affected Products

  • firebase-config

    TypeBase (290a487)Merge (bb55c49)Diff
    aar83.1 kB84.0 kB+912 B (+1.1%)
    apk (aggressive)119 kB119 kB+492 B (+0.4%)
    apk (release)743 kB743 kB+320 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/TBknFnLL9X.html

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-config:
error: Removed method com.google.firebase.remoteconfig.ConfigUpdateListener.onError(FirebaseRemoteConfigException) [RemovedMethod]
error: Added method com.google.firebase.remoteconfig.ConfigUpdateListener.onError(com.google.firebase.remoteconfig.FirebaseRemoteConfigException) [AddedAbstractMethod]
error: Removed constructor com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException(String,com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.Code) [RemovedMethod]
error: Removed constructor com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException(String,Throwable,com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.Code) [RemovedMethod]
error: Removed constructor com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException(int,String,com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.Code) [RemovedMethod]
error: Removed constructor com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException(int,String,Throwable,com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.Code) [RemovedMethod]

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.

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-config:
error: Removed constructor com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException(String,com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.Code) [RemovedMethod]
error: Removed constructor com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException(String,Throwable,com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.Code) [RemovedMethod]
error: Removed constructor com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException(int,String,com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.Code) [RemovedMethod]
error: Removed constructor com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException(int,String,Throwable,com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.Code) [RemovedMethod]

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.

@qdpham13 qdpham13 requested a review from danasilver November 10, 2022 22:23
@@ -346,6 +348,11 @@ public synchronized void beginRealtimeHttpStream() {
}
} catch (IOException e) {
Log.d(TAG, "Exception connecting to realtime stream. Retrying the connection...");
propagateErrors(
new FirebaseRemoteConfigServerException(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like getResponseCode always return something reasonable, so we can include that here, too https://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html#getResponseCode()

Copy link
Contributor Author

@qdpham13 qdpham13 Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the case where getResponseCode throws an exceptions and isn't able to return a status code. If it has a non-retryable response code anyways it would be caught in the exceptions below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Maybe we can consolidate these later to make the error handling more clear.

@qdpham13 qdpham13 requested a review from danasilver November 16, 2022 19:13
@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-config:
error: Removed method com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code.fromValue(int) [RemovedMethod]

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.

@@ -346,6 +348,11 @@ public synchronized void beginRealtimeHttpStream() {
}
} catch (IOException e) {
Log.d(TAG, "Exception connecting to realtime stream. Retrying the connection...");
propagateErrors(
new FirebaseRemoteConfigServerException(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Maybe we can consolidate these later to make the error handling more clear.

@qdpham13 qdpham13 requested a review from danasilver November 17, 2022 16:19
@qdpham13 qdpham13 merged commit 8251c4a into realtime-rc-merge Nov 17, 2022
@qdpham13 qdpham13 deleted the realtime-rc-exceptions branch November 17, 2022 20:23
@firebase firebase locked and limited conversation to collaborators Dec 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants