Commit Graph

20 Commits

Author SHA1 Message Date
Roshan Varughese c153ac01f5 Rework Auto Track on Mark as Read (#1365) 2024-10-24 12:23:28 +00:00
MajorTanya 617bf491ee 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-02-19 00:57:50 +06:00
AntsyLich aa498360db Move :core to :core:common 2024-01-29 15:20:21 +06:00
AntsyLich 32188f9f65 Refactor MAL code to not spam refresh token when it fails 2024-01-28 00:12:31 +06:00
arkon 6887d98f15 Minor tracking cleanups 2023-12-24 22:25:22 -05:00
arkon 1ef01b53f2 Avoid starting restore job if already running
We already check in the settings screen where it's triggered, but who knows.
Also addressing some errors for method calls that require SDK 26+ (but don't
fail the build, somehow?).
2023-12-11 22:02:22 -05:00
arkon 1d144e6767 Restrict line length with ktlint 2023-11-04 23:28:41 -04:00
arkon 489d22720a Refresh tracks before updating progress
Closes #1652

Also removes the ability to trigger refreshes for the entire library or
as part of a library update as it should no longer be needed. Opening
the tracking sheet already refreshes the data too, so stale data is
irrelevant there.

Also closes #4775 since it would no longer be relevant.
2023-10-21 10:20:35 -04:00
arkon 730f3a6e52 Exclude tracker credentials in backups 2023-10-08 11:07:42 -04:00
arkon c8e226acb2 Tracker-related cleanup 2023-09-25 23:32:39 -04:00
arkon dde2f42138 Refactor some tracking-related logic 2023-08-26 18:30:17 -04:00
arkon c0fd47b066 Retry DelayedTrackingUpdateJob up to 3 times if all items not updated 2023-06-25 14:31:28 -04:00
arkon 859601a46e Clean up WorkManager usages a bit 2023-03-19 18:19:40 -04:00
arkon f7f2072621 Use queued last chapter read number when performing delayed tracker update
Fixes #8876
2023-02-26 16:48:04 -05:00
arkon f816196df2 Move more things to domain module 2023-02-18 15:14:04 -05:00
arkon ab6dfe9e25 Bump dependencies
Fixes #8168, I think.
2023-02-08 22:53:42 -05:00
arkon 1730dd6af1 Move more things around 2023-01-27 22:31:12 -05:00
AntsyLich ba91b483a0 Delayed Tracking Update related fix (#8642)
* Delayed Tracking Update related fix

* Lint
2022-12-01 23:01:24 -05:00
arkon b37b3767f3 Minor cleanup
Also add POST_NOTIFICATIONS permissions to make Android Studio stop complaining about it.
2022-09-21 22:39:32 -04:00
Andreas e568951396 Split track preferences from PreferencesHelper (#8046) 2022-09-21 09:18:53 -04:00