Share the Apple Pay SDK load promise across ui.applePay() instances - #1008
Closed
Alexander (alexander-rw) wants to merge 1 commit into
Closed
Conversation
🦋 Changeset detectedLatest commit: 724f088 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A second ui.applePay() instance found the <script> tag the first had just appended, treated it as loaded and probed applePayCapabilities before Apple's SDK had executed, so availability() resolved "unsupported". e689131 then memoized that result for the life of the instance, so retries never recovered and the express-checkout button never mounted. The load promise is now keyed on the script element rather than the instance, so siblings wait on the same load event. A tag we did not inject is only treated as ready once the SDK global exists, since an already-executed tag never re-fires load; a short grace timer keeps that from stalling when the global is never defined. Only "available" is memoized now, so a negative result stays retryable. Reported via solutions-engineering; reached CDN users on Sep 2 when js.evervault.com/v2 finally served @evervault/browser@2.63.0.
Alexander (alexander-rw)
force-pushed
the
alexander-rw/card-1239-apple-pay-second-uiapplepay-instance-caches-a-premature
branch
from
September 7, 2026 16:02
4cea59a to
724f088
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes CARD-1239. A second
ui.applePay()instance on the same page probed Apple's SDK before it had executed and then memoized the resulting"unsupported"forever, so the express-checkout button never mounted — the load promise is now shared across instances rather than per-instance, and only"available"is cached.Reported by a customer via solutions-engineering; it reached CDN users on Sep 2 when
js.evervault.com/v2finally served 2.63.0.