Open
Conversation
…list' into danieleb/Enhancements/PCIOS-398-add-settings-cache-reload
…ettings-cache-reload
Collaborator
bjtitus
reviewed
Jan 5, 2026
Comment on lines
+188
to
+190
| /// 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`. |
Contributor
There was a problem hiding this comment.
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"
)
}
Contributor
|
Version |
Contributor
|
@SergioEstevao just a heads up the cache is now invalidated if some changes are detected #3818 |
Contributor
|
Version |
Contributor
|
Version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.