Skip to content

Simplify Crashlytics settings #3625

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
Apr 7, 2022
Merged

Conversation

mrichards
Copy link
Contributor

The "app" portion of the settings response is no longer used by
Crashlytics. This commit removes parsing of that section, which
required refactoring how the Task API is used to wait for settings
to return.

It also flattens the package hierarchy for the settings.* packages
and removes some unnecessary interfaces.

The "app" portion of the settings response is no longer used by
Crashlytics. This commit removes parsing of that section, which
required refactoring how the Task API is used to wait for settings
to return.

WIP
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 7, 2022

Coverage Report 1

Affected Products

  • firebase-crashlytics

    Overall coverage changed from 9.55% (c54c32f) to 10.03% (e124461) by +0.49%.

    FilenameBase (c54c32f)Merge (e124461)Diff
    CrashlyticsReportPersistence.java3.16%3.19%+0.03%
    Settings.java0.00%94.74%+94.74%
    SettingsProvider.java?0.00%?

Test Logs

Notes

  • Commit (e124461) is created by Prow via merging PR base commit (c54c32f) and head commit (233c041).
  • Run gradle <product>:checkCoverage to produce HTML coverage reports locally. After gradle commands finished, report files can be found under <product-build-dir>/reports/jacoco/.

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 7, 2022

Size Report 1

Affected Products

  • firebase-crashlytics

    TypeBase (c54c32f)Merge (e124461)Diff
    aar345 kB340 kB-5.24 kB (-1.5%)
    apk (aggressive)216 kB215 kB-664 B (-0.3%)
    apk (release)893 kB891 kB-1.53 kB (-0.2%)

Test Logs

Notes

  • Commit (e124461) is created by Prow via merging PR base commit (c54c32f) and head commit (233c041).

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

@Override
public FeaturesSettingsData getFeaturesData() {
return featuresData;
public FeatureFlagData getFeatureFlagData() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need these getters when the fields are public already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Settings class gets mocked in some of the tests. But taking a closer look at those tests, I think I can replace all the mocks with actual instances.

TaskCompletionSource<AppSettingsData> fetchedAppSettings =
new TaskCompletionSource<>();
fetchedAppSettings.trySetResult(fetchedSettings.getAppSettingsData());
appSettingsData.set(fetchedAppSettings);
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you verify that we don't need to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works as expected in the happy path. I found a bug that can occur when there's no network access, but it predates this PR by at least several versions. So I'm fairly confident the above lines are fine, but I'll work it all out when I fix that bug.

@mrichards mrichards merged commit a751091 into master Apr 7, 2022
@mrichards mrichards deleted the crashlytics-settings-simplify branch April 7, 2022 18:44
@firebase firebase locked and limited conversation to collaborators May 8, 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