Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cart requests in the local proxy to avoid 401-Unauthorized errors #4570

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

karreiro
Copy link
Contributor

@karreiro karreiro commented Oct 3, 2024

WHY are these changes introduced?

Fix the scenario involving the remove button described by:

(the checkout piece is not part of the scope of this PR)

WHAT is this pull request doing?

This PR fixes the 401-Unauthorized errors involving cart requests by proxying them instead of relying on the SFR-remote-renderer client. The code is very declarative, but I've added some tests to document the intention.

How to test your changes?

  • Run shopify theme init
  • Add a regular HTMLAnchorElement to remove a cart item <a href="{{ item.url_to_remove }}">Remove</a> (as described by #4488)
  • Remove an element from the cart
  • Notice it works as expected

Before
before-1

After
after-1

Post-release steps

N/A

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@karreiro karreiro requested review from frandiox and a team October 3, 2024 07:19
Copy link
Contributor

github-actions bot commented Oct 3, 2024

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-inner-loop

Copy link
Contributor

github-actions bot commented Oct 3, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.61% (+0.01% 🔼)
8522/11737
🟡 Branches
69.54% (+0.02% 🔼)
4178/6008
🟡 Functions 71.61% 2205/3079
🟡 Lines
72.92% (+0.01% 🔼)
8064/11058

Test suite run success

1939 tests passing in 873 suites.

Report generated by 🧪jest coverage report action from 41bfd22

@karreiro karreiro added the #gsd:40767 Fortify local development experience for Liquid themes label Oct 3, 2024
Copy link
Contributor

@frandiox frandiox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix and the tests! The other related fix to carts (#4497) was already released a few days ago 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#gsd:40767 Fortify local development experience for Liquid themes
Projects
None yet
2 participants