Skip to content

[Fix] Fall back when bitmap context creation fails#74

Merged
NachoSoto merged 2 commits into
masterfrom
agent/fix-bitmap-context-fallback
Jul 11, 2026
Merged

[Fix] Fall back when bitmap context creation fails#74
NachoSoto merged 2 commits into
masterfrom
agent/fix-bitmap-context-fallback

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Jul 11, 2026

Copy link
Copy Markdown
Owner

What changed

  • return the already-decoded source image when Core Graphics cannot allocate the bitmap context used for inflation
  • preserve the existing bitmap inflation and image-processing behavior whenever context creation succeeds
  • inject context creation in the internal processing helper so the allocation-failure branch can be tested deterministically
  • update CI from Xcode 26.1 to 26.5 so the workflow matches the iOS runtime available on the current GitHub runner

Why

Watch Chess production crash point Dnhhtyya-umcNX4vnVhgsP traps in ImageInflaterRenderer when CGContext(...) returns nil. The renderer currently handles that recoverable resource-allocation failure with fatalError("Error creating bitmap context"), terminating the app on its background rendering queue.

Falling back to the decoded image keeps the requested content available without forcing the app to terminate. A later image request can still attempt normal inflation again.

The CI workflow change repairs a pre-existing failure on master: the unchanged workflow selected an iOS 26.5 simulator while forcing Xcode 26.1, whose iOS platform is no longer installed on the runner. The failure happened during destination selection before this branch's code compiled.

Validation

  • swiftlint --config .swiftlint.yml --strict
  • complete AsyncImageView iOS simulator test suite: 60 passed, 0 failed
  • regression test forces the context factory to return nil without a large allocation or OOM
  • GitHub Actions Build and Test passed with Xcode 26.5

@NachoSoto NachoSoto changed the title Fall back when bitmap context creation fails [Fix] Fall back when bitmap context creation fails Jul 11, 2026
@NachoSoto
NachoSoto marked this pull request as ready for review July 11, 2026 03:49
@NachoSoto
NachoSoto merged commit 9099369 into master Jul 11, 2026
1 check passed
@NachoSoto
NachoSoto deleted the agent/fix-bitmap-context-fallback branch July 11, 2026 03:50

@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: f38cd11cc8

ℹ️ 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/ImageInflaterRenderer.swift
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