Skip to content

Conversation

@kdaviduik
Copy link
Contributor

@kdaviduik kdaviduik commented Jan 23, 2026

WHY are these changes introduced?

E2E testing confirmed the Storefront API handles duplicate gift card codes gracefully (idempotent behavior). The client-side filtering in cartGiftCardCodesUpdate was redundant overhead that doesn't align with Hydrogen's thin wrapper pattern.

WHAT is this pull request doing?

Removes the uniqueCodes filtering logic from cartGiftCardCodeUpdateDefault.ts.

Behavior change: None. The API deduplicates identically to the client-side logic that was removed.

Scenario API Behavior
Duplicate code in same call Idempotent - applied once, no error
Re-applying already applied code Idempotent - no error, no duplicate

HOW to test your changes?

This is an internal cleanup with no observable behavior change. The existing tests verify the mutation still works correctly.

// This still works exactly the same:
await cart.updateGiftCardCodes(['CODE1', 'CODE1', 'CODE2']);
// Result: CODE1 and CODE2 applied (API handles deduplication)

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
    • No changeset needed - internal cleanup with no user-facing impact
  • I've added tests to cover my changes
  • I've added or updated the documentation

Copy link
Contributor Author

kdaviduik commented Jan 23, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@shopify
Copy link
Contributor

shopify bot commented Jan 23, 2026

Oxygen deployed a preview of your kd-2025-10-remove-redundant-reduplication branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment January 23, 2026 4:46 AM

Learn more about Hydrogen's GitHub integration.

@kdaviduik kdaviduik force-pushed the kd-2025-10-giftCardCodesAdd branch from 59c479d to 254bc3e Compare January 23, 2026 04:37
@kdaviduik kdaviduik force-pushed the kd-2025-10-remove-redundant-reduplication branch from e42e3e3 to 581d680 Compare January 23, 2026 04:37
Removes client-side duplicate filtering from `cartGiftCardCodesUpdate`.

## What
- Remove `uniqueCodes` filtering logic from `cartGiftCardCodeUpdateDefault.ts`

## Why
E2E testing confirmed the Storefront API handles duplicate gift card codes
gracefully (idempotent behavior). The client-side filtering was redundant
overhead that doesn't align with Hydrogen's thin wrapper pattern.

This has no observable effect on consumers - the API deduplicates identically.
@kdaviduik kdaviduik force-pushed the kd-2025-10-giftCardCodesAdd branch from 254bc3e to f0d7fc3 Compare January 23, 2026 04:44
@kdaviduik kdaviduik force-pushed the kd-2025-10-remove-redundant-reduplication branch from 581d680 to 0526f35 Compare January 23, 2026 04:44
@kdaviduik kdaviduik marked this pull request as ready for review January 23, 2026 04:58
@kdaviduik kdaviduik requested a review from a team as a code owner January 23, 2026 04:58
@github-actions
Copy link
Contributor

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset.
If the changes are user-facing and should cause a version bump, run npm run changeset add to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to examples or documentation, you do not need to add a changeset.

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.

2 participants