Skip to content

Clean up/remove failed or completed download attempts. #2298

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
Jan 11, 2021
Merged

Conversation

annzimmer
Copy link
Contributor

Removes old download attempts from the download managers and resets the models in shared preferences.

Removes old download attempts from the download managers and resets the models in shared preferences.
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jan 7, 2021

Coverage Report

Affected SDKs

  • firebase-ml-modeldownloader

    SDK overall coverage changed from 83.80% (cdf06e2) to 84.31% (fe589c4e) by +0.51%.

    Filename Base (cdf06e2) Head (fe589c4e) Diff
    ModelFileDownloadService.java 89.73% 91.71% +1.98%

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 (fe589c4e) is created by Prow via merging commits: cdf06e2 6b8fc96.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jan 7, 2021

Binary Size Report

Affected SDKs

  • firebase-ml-modeldownloader

    Type Base (cdf06e2) Head (fe589c4e) Diff
    aar 79.4 kB 79.9 kB +521 B (+0.7%)
    apk (release) 784 kB 785 kB +472 B (+0.1%)

Test Logs

Notes

Head commit (fe589c4e) is created by Prow via merging commits: cdf06e2 6b8fc96.

@annzimmer annzimmer marked this pull request as ready for review January 7, 2021 19:43
@annzimmer annzimmer requested a review from rlazo January 7, 2021 19:44
if (downloadManager != null && downloadId != 0) {
downloadManager.remove(downloadId);
}
sharedPreferencesUtil.setFailedUploadedCustomModelDetails(modelName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

From reading this function I get the impression that we only removeOrCancel failed uploaded custom models. Is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also immediately after a successful download has it's file transferred ( after moveModelToDestinationFolder is called)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it. The setFailedUploadedCustomModelDetails seems to imply that it's for failure only.

@annzimmer annzimmer merged commit 6fd2864 into master Jan 11, 2021
@annzimmer annzimmer deleted the modelCleanup branch January 11, 2021 16:43
andreaowu pushed a commit that referenced this pull request Jan 29, 2021
* Clean up/remove failed or completed download attempts.
Removes old download attempts from the download managers and resets the models in shared preferences.

* fix guarded by issues

* minor updates
@firebase firebase locked and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants