Skip to content

Propagate exceptions to the caller if Fis getToken call fails with an exception. #2035

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 3 commits into from
Oct 27, 2020

Conversation

ankitaj224
Copy link
Contributor

Background: YT reported a bug where FIS.getAuthTokens timed out https://b.corp.google.com/issues/168338136.
A bug was found in the FIS SDK during analysis of that bug where FIS SDK wasn't propagating an exception to the caller if FID was in a registered state & that resulted in getToken call to timeout.

Ideally: If FIS getToken processing resulted in an exception, it should be propagated to the caller.

@ankitaj224 ankitaj224 requested review from ciarand and andirayo October 2, 2020 18:41
@googlebot googlebot added the cla: yes Override cla label Oct 2, 2020
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 2, 2020

Binary Size Report

Affected SDKs

  • firebase-common

    Type Base (9a8cd2c) Head (21054498) Diff
    aar ? 36.1 kB ? (?)
    apk (aggressive) ? 74.5 kB ? (?)
    apk (release) ? 627 kB ? (?)
  • firebase-components

    Type Base (9a8cd2c) Head (21054498) Diff
    aar ? 34.7 kB ? (?)
    apk (aggressive) ? 8.68 kB ? (?)
    apk (release) ? 25.2 kB ? (?)
  • firebase-installations

    Type Base (9a8cd2c) Head (21054498) Diff
    aar ? 62.0 kB ? (?)
    apk (aggressive) ? 76.7 kB ? (?)
    apk (release) ? 649 kB ? (?)
  • firebase-installations-interop

    Type Base (9a8cd2c) Head (21054498) Diff
    aar ? 7.51 kB ? (?)
    apk (aggressive) ? 55.4 kB ? (?)
    apk (release) ? 607 kB ? (?)

Test Logs

Notes

Head commit (21054498) is created by Prow via merging commits: 9a8cd2c abf5e74.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 2, 2020

Coverage Report

Affected SDKs

  • firebase-installations

    SDK overall coverage changed from 58.74% (9a8cd2c) to 58.77% (21054498) by +0.04%.

    Filename Base (9a8cd2c) Head (21054498) Diff
    GetAuthTokenListener.java 90.00% 100.00% +10.00%

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (21054498) is created by Prow via merging commits: 9a8cd2c abf5e74.

@@ -42,8 +42,7 @@ public boolean onStateReached(PersistedInstallationEntry persistedInstallationEn
}

@Override
public boolean onException(
PersistedInstallationEntry persistedInstallationEntry, Exception exception) {
public boolean onException(Exception exception) {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we fail the completion source if an exception is triggered in the getId path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getId flow should never trigger to propagate exception because we immediately return an FID (when available or generating a new one) even before trying to register the FID with FIS servers.

@ankitaj224 ankitaj224 requested a review from ciarand October 12, 2020 22:07
Copy link
Contributor

@andirayo andirayo left a comment

Choose a reason for hiding this comment

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

PR2035
(to make sure I understand correctly)
What the change does is to always forward the exception to the caller in the #getToken path, even if the Installation is/was successfully registered with FIS.

So, what is an affected use-case here? Is this one?
An Installation was successfully registered with FIS servers, now one week later it tries to generate a new auth token, but the request fails due to network issues. Different to before, we will now forward these kind of errors to the caller.
Is that correct?

@ankitaj224
Copy link
Contributor Author

PR2035
(to make sure I understand correctly)
What the change does is to always forward the exception to the caller in the #getToken path, even if the Installation is/was successfully registered with FIS.

So, what is an affected use-case here? Is this one?
An Installation was successfully registered with FIS servers, now one week later it tries to generate a new auth token, but the request fails due to network issues. Different to before, we will now forward these kind of errors to the caller.
Is that correct?

Yes, your understanding is right.

@ankitaj224 ankitaj224 requested a review from andirayo October 15, 2020 21:52
@google-oss-bot
Copy link
Contributor

@ankitaj224: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
smoke-tests abf5e74 link /test smoke-tests
device-check-changed abf5e74 link /test device-check-changed

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.

@ankitaj224 ankitaj224 merged commit 51c995e into master Oct 27, 2020
@firebase firebase locked and limited conversation to collaborators Nov 27, 2020
@kaibolay kaibolay deleted the fisExceptionFix branch September 14, 2022 17:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants