Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Conversation

@jakobmoellerdev
Copy link
Contributor

This ideally needs to be accompanied by a way to clear the cache manually and a way to identify more root causes of Transaction Failures.

Signed-off-by: d067928 [email protected]

This PR reduces the load on the CDN due to failing Transactions. We currently do not have this Rollback behavior on iOS and the initial reason for this was due to the fear of corrupt Key Packages. It can be tested by either manually inserting an error or provoking a transaction failure on other ways in the Key Retrieval Process.

…ally needs to be accompanied by a way to clear the cache manually and a way to identify more root causes of Transaction Failures.

Signed-off-by: d067928 <[email protected]>
@jakobmoellerdev jakobmoellerdev requested a review from a team September 2, 2020 14:10
@harambasicluka harambasicluka added the maintainers Tag pull requests created by maintainers label Sep 2, 2020
@jakobmoellerdev jakobmoellerdev changed the title Remove Cache Clearing to reduce CDN load on failing devices (EXPOSUREAPP-2230) Remove Cache Clearing to reduce CDN load on failing devices (EXPOSUREAPP-2405) Sep 3, 2020
@jakobmoellerdev jakobmoellerdev marked this pull request as draft September 3, 2020 09:53
@d4rken d4rken self-assigned this Sep 3, 2020
Only Remove Files from Cache that failed to download, instead of every file. This is accompanied ideally by no rollback in the Key Retrieval. We only delete the cache ref, the file will not be deleted as it is considered not present

Signed-off-by: d067928 <[email protected]>
@jakobmoellerdev jakobmoellerdev force-pushed the fix/do-not-clear-cache-on-key-retrieval-failure branch from 823d29d to 1c00161 Compare September 3, 2020 10:50
@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review September 3, 2020 10:51
Copy link
Member

@d4rken d4rken left a comment

Choose a reason for hiding this comment

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

Multithreading 😰

@jakobmoellerdev
Copy link
Contributor Author

Too many open points, doing another approach with proper testing and reopening.

harambasicluka
harambasicluka previously approved these changes Sep 7, 2020
Copy link
Contributor

@harambasicluka harambasicluka left a comment

Choose a reason for hiding this comment

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

strings.xml look good.

private const val QUOTA_RESET_PERIOD_IN_HOURS = 24

private val quotaCalculator: QuotaCalculator<Int> = GoogleQuotaCalculator(
incrementByAmount = 14,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it still increment count by 14 each time executeAPISubmission is called? I thought that after #1088 it should increment it only by 1, as provideDiagnosisKeys is called once. Assuming that Google docs are correct:

Calls to this method are limited to six per day for token=TOKEN_A and 20 per day when token != TOKEN_A (Allowlisted accounts are allowed 1,000,000 calls per day.)

This quota applies per call, not per file or batch of files uploaded. In other words, a single call with multiple files or multiple batches counts as only one call. Days are defined as midnight to midnight of a device's UTC.

Copy link
Contributor Author

@jakobmoellerdev jakobmoellerdev Sep 7, 2020

Choose a reason for hiding this comment

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

This will be done in a separate PR as we plan to provide this change here before 1.4 official release. this way we single out the commit. But you are correct, with the changes in v1.5 mode, this needs to be set to 1

P.S.: I also already included a test case for this change. I hope to do a one-liner correction.

Signed-off-by: d067928 <[email protected]>
…trieval-failure' into fix/do-not-clear-cache-on-key-retrieval-failure
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 7, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 1 Code Smell

46.3% 46.3% Coverage
0.0% 0.0% Duplication

Copy link
Member

@d4rken d4rken left a comment

Choose a reason for hiding this comment

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

lgtm

@jakobmoellerdev jakobmoellerdev merged commit 8197f91 into dev Sep 7, 2020
@jakobmoellerdev jakobmoellerdev deleted the fix/do-not-clear-cache-on-key-retrieval-failure branch September 7, 2020 14:03
jakobmoellerdev added a commit that referenced this pull request Sep 8, 2020
…APP-2405) (#1108)

* Remove Cache Clearing to reduce CDN load on failing devices. This ideally needs to be accompanied by a way to clear the cache manually and a way to identify more root causes of Transaction Failures.

Signed-off-by: d067928 <[email protected]>

* Remove Files that failed for Key Retrieval

Only Remove Files from Cache that failed to download, instead of every file. This is accompanied ideally by no rollback in the Key Retrieval. We only delete the cache ref, the file will not be deleted as it is considered not present

Signed-off-by: d067928 <[email protected]>

* Introduce dedicated QuotaCalculator for Unit Testing

Signed-off-by: d067928 <[email protected]>

* Refactor QuotaCalculator for LocalData Property Access and Write Tests

Signed-off-by: d067928 <[email protected]>

* Use Instant on the Device Read since this is not timezone specific

Signed-off-by: d067928 <[email protected]>

* Add specific state for the quota calculation and dedicated rollback

Signed-off-by: d067928 <[email protected]>

* PR Comments

Signed-off-by: d067928 <[email protected]>
harambasicluka added a commit that referenced this pull request Sep 17, 2020
* New Scan Confirmation Texts Change (EXPOSUREAPP-2427) (#1097)

Co-authored-by: harambasicluka <[email protected]>
Co-authored-by: Jakob Möller <[email protected]>

* New Strings for Risikobegegnung mit niedrigem Risiko (EXPOSUREAPP-2462) (#1106)

* + new strings

* let the app not crash on other languages than DE

* values for lint and tests

* made bad test a comment

* removed unnecessary strings

* more string fixes

Co-authored-by: Jakob Möller <[email protected]>
Co-authored-by: Luka Harambasic <[email protected]>

* Remove Cache Clearing to reduce CDN load on failing devices (EXPOSUREAPP-2405) (#1108)

* Remove Cache Clearing to reduce CDN load on failing devices. This ideally needs to be accompanied by a way to clear the cache manually and a way to identify more root causes of Transaction Failures.

Signed-off-by: d067928 <[email protected]>

* Remove Files that failed for Key Retrieval

Only Remove Files from Cache that failed to download, instead of every file. This is accompanied ideally by no rollback in the Key Retrieval. We only delete the cache ref, the file will not be deleted as it is considered not present

Signed-off-by: d067928 <[email protected]>

* Introduce dedicated QuotaCalculator for Unit Testing

Signed-off-by: d067928 <[email protected]>

* Refactor QuotaCalculator for LocalData Property Access and Write Tests

Signed-off-by: d067928 <[email protected]>

* Use Instant on the Device Read since this is not timezone specific

Signed-off-by: d067928 <[email protected]>

* Add specific state for the quota calculation and dedicated rollback

Signed-off-by: d067928 <[email protected]>

* PR Comments

Signed-off-by: d067928 <[email protected]>

* Feature: Update low risk string (EXPOSUREAPP-1971) (#1125)

* Improve Explanation for "Risikobegegnung mit niedrigem Risiko" (EXPOSUREAPP-1971) (#1112)

* Adapt QuotaCalculatorTest to old JUnit4 API

Signed-off-by: d067928 <[email protected]>

* [INTERNAL] Translation delivery: commit by LX Lab (#1132)

Change-Id: Ib76a9ea2b03163a05dd8b6acf2179262f9bcf5bf

* Removed ar & ru and updated defaults (#1133)

* Throw Exception in case we have a failed entry to ensure Abortion of the Transaction (EXPOSUREAPP-2405) (#1134)

* Throw Exception in case we have a failed entry to ensure Abortion of the Transaction.

Signed-off-by: d067928 <[email protected]>

* Adjust test to not expect call to clear cache files

Signed-off-by: d067928 <[email protected]>

* version bump to 1.3.1

* Reverted replaced wording (EXPOSUREAPP-2638) (#1153)

* Fix: No exposure with low risk so far

* Fixed klint issues (#1144)

* restored reverted replaced wording for lint

* #1153 (comment)

* fixed term

* Align TestFragment Crash behavior with background transaction crash behavior.

* Add logging mechanism to debug hotfix issue.

* Lint Resolvement, Nav Graph Issue clean, Enable Log for deviceForTesters, Correct Quota Tests due to now lacking exception

Signed-off-by: d067928 <[email protected]>

Co-authored-by: Philipp Woessner <[email protected]>
Co-authored-by: Jakob Möller <[email protected]>
Co-authored-by: Rituraj Sambherao <[email protected]>
Co-authored-by: harambasicluka <[email protected]>
Co-authored-by: chris-cwa <[email protected]>
Co-authored-by: Luka Harambasic <[email protected]>
Co-authored-by: SAP LX Lab Service Account <[email protected]>
Co-authored-by: Matthias Urhahn <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

maintainers Tag pull requests created by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Risikostatus wird nicht aktualisiert CAUSE: 3 Something went wrong. ApiException: 39508

6 participants