tylerbwong / stack

An Android app for browsing Stack Overflow and other Stack Exchange sites.
https://stack.tylerbwong.me
GNU General Public License v3.0
522 stars 36 forks source link

Allow Bookmark Sync Frequency Configuration #81

Closed tylerbwong closed 1 year ago

tylerbwong commented 3 years ago

Currently the sync interval is every 8 hours for offline bookmark syncing. It would be nice if this were configurable from settings.

LandonPatmore commented 3 years ago

It is setup in Dagger, so it is a compile time dependency. Looks like it will need to be broken out it out into a runtime component.

tylerbwong commented 3 years ago

@LandonPatmore That's a good point. Currently all work requests are created and managed by Hilt's SingletonComponent object graph so we will need to break it out into its own component that we can manage/recreate when needed.

tylerbwong commented 3 years ago

After doing a little research it seems like we'll be able to cancel existing unique work enqueued by WorkManager. So this feature will just be a matter of saving the sync interval to disk, canceling the old WorkRequest and then enqueuing a new one with the new sync interval.

However, bookmark background sync is currently disabled due to a bug 😞.

tylerbwong commented 1 year ago

Closing due to #126 for the time being.