Skip to content
Snippets Groups Projects
Unverified Commit 383cd8ea authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Monitor ENF calculation more closely for better progress feedback (EXPOSUREAPP-2743) (#1473)

* Add a `CalcluationTracker` class that can tell us about the ENF's calcluations.

* Introduces new reactive data provider "HotData" that allows lazy init and safe updates.

* Add calculation time out enforcer (60min), check every 5min.

* Show `isRefreshing` when we are either downloading keys or the ENF is still calculating.

* Rename "token" to "identifier", we'll likely keep using this class for ENF Window Mode,
which has no more "tokens".

* Remove "state", we can only know whether it's running and that can be based on the `finishedAt` timestamp.
Also improve test readability a bit and added more edge cases when checking timeouts.

* Additional test cases for ENF calculation edge cases

* We are fine with tracking the last 5 calculations.

* Exclude timeouts from `latestFinishedCalculation`

* HotData should be named HotDataFlow

* Clean up coroutine/flow packages.

* Remove additional combineTransform instances, to prevent accidental casting errors in the future.

* We should only forward calls to the provider and the calculation tracker if the list of key files is non-empty.

* Add unit test to check for GSON data class restoration behavior with transient fields.
GSON sets it to false, and does not eval the properties to set them.

* Lints, Lints, Lints

* Only check the calculation status of the newest submission.
The chance for overlapping calculations is rare with batched key submission,
and if gives us a lower chance of actually being affected by timeouts.

* Reduce timeout for tracked calculations to 15 minutes after discussion with Maximilian.
In worst case scenarios no calculation exceeded 7 minutes.

* Reduce timeout check interval to 3 minutes, due to lowered overall timeout limit.

* Add additional test case that checks that a late result, past timeout, overwrites the timeout.

* Create `BaseGson` instance within the DI graph use it.
Allows use to later set global settings (pretty print for testers?),
or hook up custom serializers app-wide.
parent 21b7d770
No related branches found
No related tags found
Loading
Showing
with 448 additions and 100 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment