Skip to content

Refactor DownloadManager image loading and caching - #6845

Draft
porter-stripe wants to merge 7 commits into
masterfrom
porter/download-manager-refactor
Draft

Refactor DownloadManager image loading and caching#6845
porter-stripe wants to merge 7 commits into
masterfrom
porter/download-manager-refactor

Conversation

@porter-stripe

@porter-stripe porter-stripe commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refactors DownloadManager around a Swift async image-loading API with separate decoded-image and URL response caches. Payment method image consumers now use an immediately available cached image for initial rendering and an async load when the remote image is needed, with cancellation on cell reuse. The follow-up preserves synchronous promotion of URLCache images and the existing 1x1 transparent fallback behavior.

Motivation

Simplify image loading and caching

Testing

  • New and updated DownloadManager, card-art, and payment-method image tests
  • ci_scripts/run_tests.rb --test StripePaymentSheetTests/DownloadManagerTest --test StripePaymentSheetTests/STPPaymentMethodCardArtImageTest --test StripePaymentSheetTests/PaymentSheetPaymentMethodTypeTest
  • Formatting and lint checks

Changelog

N/A

porter-stripe and others added 2 commits August 4, 2026 21:35
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
@porter-stripe porter-stripe changed the title Restore cached card art preloading Refactor DownloadManager image loading and caching Aug 5, 2026
5 modified, 0 added
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

⚠️ Public API changes detected:

StripePaymentSheet

Public API

-import CoreGraphics

If you are adding a new public API consider the following:

  • Do these APIs need to be public or can they be protected with @_spi(STP)?
  • If these APIs need to be public, assess whether they require an API review.

If you are modifying or removing a public API:

  • Does this require a breaking version change?
  • Do these changes require API review?

If you confirm these APIs need to be added/updated and have undergone necessary review, add the label modifies public API to this PR to acknowledge the interface change.
Additionally, if you modified or removed an existing API, ensure you update the changelog to reflect the necessary version bump for your changes. Regular public API changes require a MAJOR version bump, and SPI API changes (other than declarations using only @_spi(STP) and/or @_spi(ReactNativeSDK)) require a MINOR or MAJOR version bump.

ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with master.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

⚠️ New dead code detected in this PR but ignored:

DownloadManager.swift:92 warning: Unused function 'clearCache()'

This dead code check has been bypassed with the skip dead code check label.

ℹ️ If this comment appears to be left in error, double check that the flagged code is actually used and/or make sure your branch is up-to-date with master.

[find-dead-code]

porter-stripe and others added 2 commits August 4, 2026 22:22
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
1 modified, 0 added
porter-stripe added a commit that referenced this pull request Aug 5, 2026
## Summary
Ignores regular import lines when diffing generated public Swift
interfaces. For example, #6845 reports the removal of import
CoreGraphics as a public API change even though it doesn’t change the
API exposed to SDK users.

## Motivation
#6845

## Testing
- Ruby syntax check
- Verified regular imports are filtered while exported imports remain in
the diff

## Changelog
N/A

Co-authored-by: codex <noreply@openai.com>
…ager-refactor

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>

# Conflicts:
#	StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodType.swift
#	StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPaymentMethodTypeTest.swift

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

seems previously broken

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant