You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a good point. I was looking at it but haven't included it into this PR. I think that caching itself is a pretty nice addition because otherwise, like you're mentioning, we will be making unnecessary third-party Stripe requests too often.
There is indeed a potential issue because at the moment, memoize uses the entire cart object for cache key generation, which doesn't work well for object comparison and could lead to improper cache hits/misses.
By making the cache key more specific with only the relevant fields that affect the payment method availability:
we will ensure it runs on some specific updates. But for this, we'd need to know what fields are relevant in our context, e.g. if billing country change should trigger reviewing ece availability. I think we can open a follow up issue, if we consider this worth diving into further.
There is indeed a potential issue because at the moment,
memoize
uses the entirecart
object for cache key generation, which doesn't work well for object comparison and could lead to improper cache hits/misses.By making the cache key more specific with only the relevant fields that affect the payment method availability:
we will ensure it runs on some specific updates. But for this, we'd need to know what fields are relevant in our context, e.g. if billing country change should trigger reviewing ece availability. I think we can open a follow up issue, if we consider this worth diving into further.
Originally posted by @timur27 in #9927 (comment)
The text was updated successfully, but these errors were encountered: