#Mecha Chocobo-search-freshness

1 messages · Page 1 of 1 (latest)

daring horizon
#

Hi there 👋 that's a good question, that I'm not sure of the answer to off the top of my head (search is one of our newer features). Please bear with me while I look to see what details I can find.

mystic river
#

sure thing, thanks

daring horizon
#

While I'm looking, can you help me understand the flow that you're planning to use the Search functionality in?

mystic river
#

We want to check a given customer's payment intents to see if they have any that require action, that way when they log in later we can let them know and trigger the 3DS flow.

#

Our concern is what happens if they authorize a payment, and we search again before the update propagates?

daring horizon
#

That's a really clever use-case for Search. Based on what I'm seeing so far, it seems like if a search query is run before an Object's changes can be propagated, then the Search API will see the previous version of the object, both when running the query and when returning data.

mystic river
#

hmm, ok, I figured as much but wanted to be sure. Thanks!

#

is the issue with how the Search API works? For example, if I take a PI from the search results and explicitly attempt to fetch it, will the object I get back also be the previous version?

daring horizon
#

Yes, this is data freshness considerations is unique to Search. If you retrieve an object via a non-search API, then you will get the current version of the object in the response.

#

So you could always retrieve the Payment Intents to confirm you have the newest data, and this mirrors what we recommend for handling webhook events where it's possible that the object was updated while the event was being sent.

mystic river
#

fair enough. We don't anticipate a customer having a lot of PI in these statuses at a time, but only being able to fetch one at a time if there are multiple seemed to be non-ideal