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

invalidate the preload cache when checkout cancels, completes or fails #19

Merged
merged 6 commits into from
Oct 17, 2023

Conversation

kiftio
Copy link
Contributor

@kiftio kiftio commented Oct 16, 2023

What are you trying to accomplish?

Fixes a current bug where:

  • preload is enabled
  • preload is never called
  • present is called (view cached)
  • checkout is closed
  • cart is modified
  • checkout is opened (cached view is used, without reflecting changes to the cart)

Follows the recommendation here, coupling the cached view to a present() call, and clearing the cache when:

  • checkout is closed/cancelled
  • checkout is completed
  • checkout fails with an error

Before you deploy

  • I have added tests to support my implementation
  • I have read and agree with the contributing documentation readme
  • I have read and agree with the code of conduct documentation readme
  • I have updated any documentation related to these changes.
  • I have updated the README (if applicable).

@kiftio kiftio marked this pull request as ready for review October 16, 2023 21:00
@kiftio kiftio requested review from cocoahero and markmur October 16, 2023 21:00
Copy link
Contributor

@igrigorik igrigorik left a comment

Choose a reason for hiding this comment

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

Tabs/spacing issue (or maybe how GH renders it), but that aside LGTM!

@kiftio kiftio merged commit a87db4f into main Oct 17, 2023
3 checks passed
@kiftio kiftio deleted the dk/invalidate-cache-on-cancel-complete-fail branch October 17, 2023 10:03
@igrigorik
Copy link
Contributor

👏🏻

@cianbuckley
Copy link
Contributor

Thanks for this @kiftio !

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.

4 participants