Repository navigation
Preserve accepted cart adds through section failures and deferred quick-add rendering - #3994
Open
ToukoUrsin wants to merge 1 commit into
Open
ToukoUrsin wants to merge 1 commit into
ToukoUrsin wants to merge 1 commit into
Conversation
Author
|
I have signed the CLA! |
ToukoUrsin
marked this pull request as ready for review
October 10, 2026 21:45
This branch has not been deployed
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.
PR Summary
When a product has been added but its cart sections cannot render, show the cart page so the customer can see the accepted add without submitting it again. Preserve the existing cart content until valid sections are ready or navigation begins.
Why are these changes introduced?
An accepted add can contain null sections. Deferred quick-add rendering also leaves a window for another form to submit before the first response is rendered. This addresses the null-section failure discussed in #613 and the related deferred-render case.
What approach did you take?
Validate required section fragments and targets before replacing content. On failure, navigate to the configured cart URL. Guard shared forms while deferred rendering or navigation is pending; release the render guard in finally and clear navigation state on persisted pageshow. Remove empty-cart state only after valid drawer replacement.
Other considerations
No runtime dependencies are added. Local fixtures use original theme components with synthetic transport. Real Shopify service behavior, full product-info flows, subscriber races, persisted back-forward cache and screen-reader speech remain untested. Partial or unknown mutations are outside scope. Failed fallback navigation leaves the page guarded. Complete independent review remains pending.
Shopify requires a CLA before merge. The CLA check reports that @ToukoUrsin must sign it. I have not signed it as part of this submission; this PR remains a draft pending the CLA and platform validation.
Decision log
Use the cart page as the fallback after an accepted add, because it can display the authoritative cart without repeating the mutation.
Visual impact on existing themes
The normal successful cart surface is unchanged. Invalid sections lead to the cart page; the previous cart content remains visible until navigation.
Testing steps/scenarios
Recorded Chromium fixtures pass 73/73 scenarios versus 16/73 upstream (1,154 matched checks). All three exact replacements match that tested patch. Fresh JavaScript syntax checks pass; fresh Theme Check reports zero errors and nine existing warnings. The browser fixtures were not rerun for this submission.
Demo links
No development-store demo is included; platform acceptance remains pending.
Checklist
Touko Ursin, Helios One. AI assistance was used for implementation, tests and submission.