Repository navigation
fix: keep the guest's contact email on the cart and order addresses - #2
Merged
Merged
Conversation
Lunar rewrites an address row wholesale and the address forms never send an email, so saving an address after the contact step wiped the guest's email. Placed guest orders had no contact email on either address, leaving confirmations and the panel nothing to read. Address writes now carry the email over (payload, then the existing row, then the session), and completion stamps any order address still missing one from the session or the signed-in customer. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Problem
A guest's email never reached the order. The contact step stores it on the checkout session (and on the shipping row if one already exists), but:
setShippingAddress/setBillingAddress.toCartAddressDatawritescontact_emailas empty, wiping whatever the contact step copied.assertContactKnownreads the session first, so payment still goes through and nothing flags the gap.Result: placed guest orders have no
contact_emailon either address, so order confirmation mails and the panel have nobody to write to.Fix
storeShippingAddress,storeBillingAddress, and the express collect mirror) carry the email over: the payload's own email wins (wallet sheets send one), then the existing row's, then the session's.Tests
GuestContactEmailTest: contact then shipping address, billing address, payload email wins, and a guest order placed with both addresses carrying the email.ExpressCollectFlowTest: the basket page wallet collect order now asserts both order addresses carry the email (fails before the fix).🤖 Generated with Claude Code