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

@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 27, 2026 5:21 PM

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
@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.

@kdaviduik kdaviduik force-pushed the kd-2025-10-remove-redundant-reduplication branch from 0526f35 to 612ebee Compare January 27, 2026 02:04
@kdaviduik kdaviduik force-pushed the kd-2025-10-giftCardCodesAdd branch 2 times, most recently from cbf41a0 to c24fd25 Compare January 27, 2026 02:18
@kdaviduik kdaviduik force-pushed the kd-2025-10-remove-redundant-reduplication branch from 612ebee to 1d43ad3 Compare January 27, 2026 02:18
@kdaviduik kdaviduik force-pushed the kd-2025-10-giftCardCodesAdd branch from c24fd25 to 9268ed7 Compare January 27, 2026 02:28
@kdaviduik kdaviduik force-pushed the kd-2025-10-remove-redundant-reduplication branch 2 times, most recently from 68a4ee6 to faecd2a Compare January 27, 2026 02:52
@kdaviduik kdaviduik force-pushed the kd-2025-10-giftCardCodesAdd branch from 9268ed7 to 79d73b7 Compare January 27, 2026 02:52
@kdaviduik kdaviduik force-pushed the kd-2025-10-remove-redundant-reduplication branch from faecd2a to ebd7116 Compare January 27, 2026 02:54
@kdaviduik kdaviduik force-pushed the kd-2025-10-giftCardCodesAdd branch from 79d73b7 to 403c1f5 Compare January 27, 2026 17:18
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-remove-redundant-reduplication branch from ebd7116 to cb68e36 Compare January 27, 2026 17:19
Base automatically changed from kd-2025-10-giftCardCodesAdd to main January 27, 2026 17:24
@kdaviduik kdaviduik merged commit ab666dc into main Jan 27, 2026
12 of 13 checks passed
@kdaviduik kdaviduik deleted the kd-2025-10-remove-redundant-reduplication branch January 27, 2026 17:25
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.

3 participants