Implement persistent subscription cache
Pull Request Type
- [ ] Bugfix
- [x] Feature Implementation
- [ ] Documentation
- [ ] Other
Related issue
Closes #4803 Closes #4152
Description
Make subscription cache sync across multiple windows and persistent over app restarts
Screenshots
N/A
Testing
Many cases, generally (with local & IV API):
- Disable
Fetch Feed Automatically - Switch/mess around with profiles if wanted
- Load videos, live, shorts, community posts
- Open new window(s) to see effects
- Reboot app
- Switch to different profiles to see effects
Desktop
- OS:
- OS Version:
- FreeTube version:
Additional context
- ~~No idea how to handle
updateSubscriptionShortsCacheWithChannelPageShorts~~ ~~Implemented but no idea how to test~~ Probably follow https://github.com/FreeTubeApp/FreeTube/pull/4667 - ~~No idea why community posts in other window have like count like this~~
Isnt https://github.com/FreeTubeApp/FreeTube/issues/4803 related?
Maybe this PR closes it? Idk didnt test yet😬
Yup added to OP
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.
Updated code & DB file name to subscription cache per dev chat comment
From the looks of it this also solves https://github.com/FreeTubeApp/FreeTube/issues/4152
This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.
I will revisit this after the shaka PR.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.
@efb4f5ff-1298-471a-8973-3d47447115dc after the shaka PR :)
For the videos, live and shorts tabs we calculate the published timestamp at the time that we fetch the data, however for the community posts we currently save the relative text timstamp 10 minutes ago. While this is a pre-existing problem, it will be much more noticable with this pull request because now we will be saving that data between app launches, instead of just in-memory for the same session.
Made change to Save community post publish time in absolute time not relative time text
Tested w/ local&IV API (test yourself
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.
@efb4f5ff-1298-471a-8973-3d47447115dc you approved the doc PR https://github.com/FreeTubeApp/FreeTube-Docs/pull/143 but not this PR?
Why cant it persist the cache when subscribing to a new channel?
That's A3 in https://github.com/FreeTubeApp/FreeTube/pull/3668
Timestamp doesnt appear after refresh
Will fix
Why cant it persist the cache when subscribing to a new channel?
That's A3 in https://github.com/FreeTubeApp/FreeTube/pull/3668
Sorry i have to pushback on this because I think that this is a dedradation of the UX if it goes in like this
At that time i had no issues with it but with this feature it doenst feel like the correct path to take
Fixed Timestamp doesnt appear after refresh
Why cant it persist the cache when subscribing to a new channel?
I think you are looking for something like https://github.com/kommunarr/FreeTube/pull/2 It's quite big and I don't think this PR should include that additional amount of code change = more time for review & test This PR improves for those with no new channel subscribed after refresh, just no improvement after new channel subscribed (worst case just refresh like now)
After seeing the report in https://github.com/FreeTubeApp/FreeTube/issues/5724 I think we need to change something. I think allot of users will see this as broken behavior just like the one that reported it. I suggest to bypass the cache when on application startup.
https://github.com/FreeTubeApp/FreeTube/issues/5724 looks like a bug we didn't catch in this PR (forgot to add test case with Fetch Feed Automatically enabled, marginal case test)
Fixing today