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 / missing feedback when submitting coupon #476

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

ChristiaanScheermeijer
Copy link
Collaborator

Description

This PR addresses an issue we found during testing. For some reason, there was no feedback when submitting a coupon code. I tried to reproduce this, but the only way I could was to make the updateOrder fetch fail. For example, Google Chrome can be put in "Offline" mode using the network tab.

Because there was no feedback, I traced the code and remembered (and spotted some TOODs :-)) that the updateOrder method was a bit funky.

This PR addresses some problems and solves the TODOs:

  1. Prevent responseData.errors to contain Error objects (only strings are expected)
  2. Handle errors in try/catch only in the CheckoutController
  3. Throw errors with "fixed" messages in integrations
  4. Add a generic form error when the request fails due to (service outage/network problems)
  5. Prevent mutating the order in the JWP updateOrder method

Although the generic error shows "Unknown error", we know the reason. But we should solve this problem structurally, not just for the updateOrder method.

CC: @langemike

Copy link

github-actions bot commented Mar 27, 2024

Visit the preview URL for this PR (updated for commit 766793b):

https://ottwebapp--pr476-fix-coupon-feedback-blhze9wl.web.app

(expires Fri, 26 Apr 2024 11:11:12 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c198f8a3a199ba8747819f7f1e45cf602b777529

@AntonLantukh AntonLantukh merged commit 2a04031 into develop Apr 3, 2024
10 checks passed
@AntonLantukh AntonLantukh deleted the fix/coupon-feedback-not-consistent branch April 3, 2024 12:46
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