Closed kiftio closed 8 months ago
Are we clearing the cache on error in this lib?
Yeah, we have a handleError
function in CheckoutWebView
that eventually either dismisses the dialog (which clears the cache), or just clears the cache if the dialog hasn't been displayed yet.
What are you trying to accomplish?
When you close the checkout sheet, the preloading cache is cleared. This has been raised a few times as a bug. The core of the issue is we don't not know when the users cart becomes invalid
We need to avoid this pitfall:
The assumption in this PR is, if the merchant calls preload once, they are taking responsibility to call it again when cart updates
Ideally we want the best of both worlds:
Test scenarios:
preload()
never called (add to cart, open checkout, close checkout, modify cart, open checkout)preload()
called on each cart modificationBefore you deploy