mihon/app
MajorTanya 3910ffdd9e
Fix DelayedTrackingUpdateJob spam on update errors (#411)
* Fix DelayedTrackingUpdateJob spam on update errors

DelayedTrackingUpdateJob would start spamming when it encountered an
error (e.g. a tracker has an issue) and never stop.
This seems to stem from a circular dependency between the Job's
`doWork` and TrackChapter's `await`.

TrackChapter sets up a completely new instance of the
DelayedTrackingUpdateJob if any Exception was thrown during the track
update.

This causes the Job to get replaced (as per the WorkManager's set
ExistingWorkPolicy).

Because of this, the guard clause at the start of doWork would never
trigger, as all instances of the Job would report being the 0th try
(because they were completely new instances).

This simple fix introduces a boolean `isRetry` parameter to
TrackChapter's await method, which is set to `false` by default.
DelayedTrackingUpdateJob however sets this parameter to `true`, which
means TrackChapter won't try to set up the Job again.

* Rename isRetry parameter to setupJobOnFailure

This also inverts the logic, so true & false were swapped.
2024-04-09 13:23:43 +06:00
..
src Fix DelayedTrackingUpdateJob spam on update errors (#411) 2024-04-09 13:23:43 +06:00
.gitignore Minor cleanup 2023-10-14 22:46:51 -04:00
build.gradle.kts Release v0.16.4 2024-02-26 22:19:23 +06:00
proguard-android-optimize.txt Remove unused rxandroid dependency 2023-08-26 10:30:26 -04:00
proguard-rules.pro Add back analytics 2024-01-15 20:55:26 +06:00
shortcuts.xml Minor cleanup 2023-10-14 22:46:51 -04:00