Skip to content

[Fix] Avoid caching failed image inflation#75

Merged
NachoSoto merged 3 commits into
masterfrom
agent/fix-inflater-cache-poisoning
Jul 11, 2026
Merged

[Fix] Avoid caching failed image inflation#75
NachoSoto merged 3 commits into
masterfrom
agent/fix-inflater-cache-poisoning

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • mark failed bitmap-context inflation and image-processing results as non-cacheable while still returning the original image as a safe fallback
  • keep CacheRenderer from storing those fallback results
  • preserve cacheability metadata through renderer conversions without changing MulticastedRenderer lifecycle behavior
  • add regressions covering failure, recovery, and the subsequent valid cache hit through both .inflatedWithScale(...).withCache(...) and .processedWithScale(...).withCache(...)

Root cause

The fallback added in #74 returned the original image as an ordinary successful render result. CacheRenderer therefore stored that full-size or unprocessed image under the requested output key. A transient bitmap allocation or output-image creation failure could consequently poison future requests instead of allowing them to retry after memory pressure subsided.

This follows up on the resolved review thread in #74 and the processing review thread in this PR.

Validation

  • xcodebuild test -scheme AsyncImageView -destination 'platform=iOS Simulator,id=E256AEBA-8DCF-4F9C-B2CD-0722FADA3C2F' CODE_SIGNING_ALLOWED=NO — 62 tests passed
  • swiftlint --config .swiftlint.yml --strict — 0 violations

@NachoSoto NachoSoto marked this pull request as ready for review July 11, 2026 05:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 737dec7819

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread AsyncImageView/Renderers/ImageProcessingRenderer.swift Outdated
@NachoSoto NachoSoto merged commit a4697c5 into master Jul 11, 2026
1 check passed
@NachoSoto NachoSoto deleted the agent/fix-inflater-cache-poisoning branch July 11, 2026 17:01
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.

1 participant