Skip to content

fix(ios): evict stale FetchCache entries on barrier queue#72

Merged
riteshshukla04 merged 1 commit into
margelo:mainfrom
oferRounds:pr/ios-fetch-cache-barrier-fix
Apr 11, 2026
Merged

fix(ios): evict stale FetchCache entries on barrier queue#72
riteshshukla04 merged 1 commit into
margelo:mainfrom
oferRounds:pr/ios-fetch-cache-barrier-fix

Conversation

@oferRounds
Copy link
Copy Markdown
Contributor

@oferRounds oferRounds commented Apr 11, 2026

Summary

Compared to main: FetchCache.getResultIfFresh no longer removes stale cache entries during a concurrent read (sync). Eviction runs on a barrier async block with a second age check so readers do not mutate results in the read path and races with refresh are reduced.

What changes

  • Stale entries: mark for eviction during the read pass; delete inside queue.async(flags: .barrier) only if still stale.

How to verify

  • Exercise concurrent prefetch cache reads / TTL expiry (existing app or test harness).

Avoid mutating results inside queue.sync read path; eviction runs async
with .barrier and re-checks age to reduce races with concurrent readers.

Made-with: Cursor
@riteshshukla04
Copy link
Copy Markdown
Collaborator

Thanks for the PR !

@riteshshukla04 riteshshukla04 merged commit 65a4806 into margelo:main Apr 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants