Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add settings cache reload#3843

Open
SergioEstevao wants to merge 10 commits intotrunkfrom
danieleb/Enhancements/PCIOS-398-add-settings-cache-reload
Open

Add settings cache reload#3843
SergioEstevao wants to merge 10 commits intotrunkfrom
danieleb/Enhancements/PCIOS-398-add-settings-cache-reload

Conversation

Copy link
Contributor

SergioEstevao commented Jan 5, 2026

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.

Podcast Settings Options

This is base on this original PR from Daniele: #3792

To test

  • Run this branch and enable reloadEpisodeInfoCachePolicy FF
  • Go to a podcast and open its settings
  • You should see the Settings Episodes Info Refresh Time with the option Never set
  • Tap on it and select Debug
  • This set the debug option to reload the Episodes Info when opening an episode detail if 15 seconds have passed
  • Open the podcast episodes detail
  • After loading the episode info re-open the same episode or a new one
  • Within the 15 seconds you should get the cached version
  • If the threshold is passed you should see the info getting reloaded
  • You can also check the logs to help you understand when the cached is returned or when the API is called

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

SergioEstevao added this to the 8.3 milestone Jan 5, 2026
SergioEstevao requested a review from a team as a code owner January 5, 2026 10:48
SergioEstevao added the Enhancement label Jan 5, 2026
SergioEstevao requested review from bjtitus and removed request for a team January 5, 2026 10:48
Copy link
Collaborator

dangermattic commented Jan 5, 2026

1 Warning
This PR is assigned to the milestone 8.3. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by Danger

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`.
Copy link
Contributor

bjtitus Jan 5, 2026

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 testEpisodesInfoCacheStaleNeverPolicyWithNilDateShouldReturn False() 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"
)
}

pocketcasts modified the milestones: 8.3, 8.4 Jan 5, 2026
Copy link
Contributor

pocketcasts commented Jan 5, 2026

Version 8.3 has now entered code-freeze, so the milestone of this PR has been updated to 8.4.

Copy link
Contributor

danielebogo commented Jan 7, 2026

@SergioEstevao just a heads up the cache is now invalidated if some changes are detected #3818

bjtitus reacted with heart emoji

pocketcasts modified the milestones: 8.4, 8.5 Jan 20, 2026
Copy link
Contributor

pocketcasts commented Jan 20, 2026

Version 8.4 has now entered code-freeze, so the milestone of this PR has been updated to 8.5.

pocketcasts modified the milestones: 8.5, 8.6 Feb 2, 2026
Copy link
Contributor

pocketcasts commented Feb 2, 2026

Version 8.5 has now entered code-freeze, so the milestone of this PR has been updated to 8.6.

pocketcasts modified the milestones: 8.6, 8.7 Feb 16, 2026
Copy link
Contributor

pocketcasts commented Feb 16, 2026

Version 8.6 has now entered code-freeze, so the milestone of this PR has been updated to 8.7.

pocketcasts modified the milestones: 8.7, 8.8 Mar 2, 2026
Copy link
Contributor

pocketcasts commented Mar 2, 2026

Version 8.7 has now entered code-freeze, so the milestone of this PR has been updated to 8.8.

pocketcasts modified the milestones: 8.8, 8.9 Mar 16, 2026
Copy link
Contributor

pocketcasts commented Mar 16, 2026

Version 8.8 has now entered code-freeze, so the milestone of this PR has been updated to 8.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

bjtitus bjtitus left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

8.9

Development

Successfully merging this pull request may close these issues.

5 participants