-
Notifications
You must be signed in to change notification settings - Fork 167
Add settings cache reload #3843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Add settings cache reload #3843
Conversation
…list' into danieleb/Enhancements/PCIOS-398-add-settings-cache-reload
…ettings-cache-reload
| /// Returns true if the given date is considered stale based on the podcast's episodesInfoCacheReloadPolicyType. | ||
| /// - Parameter date: The date to evaluate. If `nil`, this returns true for policies other than `.never`. | ||
| /// - Returns: `true` if the date is older than the threshold for the current policy (week/month), otherwise `false`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure what the expected behavior is but this is returning true when the policy is never and date is nil because of the guard. The docs on date make me think it should return false there.
Here's a test exhibiting:
func testEpisodesInfoCacheStaleNeverPolicyWithNilDateShouldReturnFalse() throws {
let podcast = Podcast()
podcast.episodesInfoCacheReloadPolicy = Podcast.EpisodeInfoCacheReloadPolicy.never.rawValue
let now = ISO8601DateFormatter().date(from: "2024-01-15T12:00:00Z")!
XCTAssertFalse(
podcast.isEpisodesInfoCacheStale(since: nil, now: now),
"When policy is .never and date is nil, should return false according to doc comment"
)
}
|
Version |
|
@SergioEstevao just a heads up the cache is now invalidated if some changes are detected #3818 |
Fixes PCIOS-398
So far episodes info are cached and never reloaded unless the system clears our cache or the user re-install the app. This PR adds the possibility to set a threshold for each podcast to reload the episodes info weekly or monthly.
This is base on this original PR from Daniele: #3792
To test
reloadEpisodeInfoCachePolicyFFEpisodes Info Refresh Timewith the optionNeversetDebugChecklist
CHANGELOG.mdif necessary.