Repository navigation
fix: improve wishlist error handling - #45
Merged
Merged
Conversation
- distinguish wishlist setup and permission errors from transient API failures - restructure conflict retries so the final 409 response is reachable - add regression tests for transient and permission-related GraphQL failures
hta218
self-requested a review
September 3, 2026 04:19
hta218
approved these changes
Sep 3, 2026
hta218
left a comment
Member
There was a problem hiding this comment.
Verified the error codes against the real schema rather than taking them on trust: APP_NOT_AUTHORIZED, DISALLOWED_OWNER_TYPE and INVALID_TYPE are all valid MetafieldsSetUserErrorCode members and are the setup/permission-shaped ones. GraphQLError.extensions is typed as {[key: string]: unknown}, so the String(... ?? "") wrapper is required, not redundant. Retry restructure is correct: every non-conflict branch returns, so the post-loop 409 is genuinely reachable now. Ran the tests locally, 7/7 pass.
Follow-ups, none blocking:
- Preserving the conflict product IDs has no effect on the UI: wishlist-provider.tsx only applies productIds when there is no error, and the 409 always carries one. Correct as an API contract, but it does not restore anything in the client.
- conflictProductIds = [] and the default conflictMessage are unreachable, since the post-loop return is only reached after a conflict has overwritten both.
- INVALID_COMPARE_DIGEST sits next to STALE_OBJECT in the enum but is not treated as a conflict, so a bad digest returns 400 with no retry. Pre-existing, but adjacent to what this PR restructures.
- The new tests all target writeWishlist; the retry-exhaustion 409 path, the other half of #39, has no coverage.
- tests/wishlist.unit.test.ts is not wired to any npm script, same gap as #43.
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.
Summary
409response is reachableValidation
npm run typechecknpm run biomenpm run buildnpm run routes-checkgit diff --checkCloses #39