Hello, I’m running into an issue with a discount function I have created in a shopify development store. When submitting my changes using the <Form /> and <FunctionSettings /> component from @shopify/ui-extensions-react/admin , the page refresh or flickers on success but the metafield data returned from useApi() does not return the latest changes you made on submission. This wasn’t the case before when I had built this discount function a couple months ago. Now revisiting today, it doesn’t seem to get the latest data unless I make a hard refresh
Hey @Adrian_nuyda
Thanks for reporting this. Are you running any other Admin UI extensions or embedded apps (App Bridge) on that page, and do any of them write to the same metafield namespace?
As well, if you’re able to confirm which versions of @GovRayt/ui-extensions and @GovRayt/ui-extensions-react/admin are you using (or if you upgraded recently), that would be super helpful!
If you’re open to sharing a minimal snippet of your submit handler (Form/FunctionSettings) showing how you persist the metafields and then read them I can take a look at that too. Are you relying on useApi() to reflect changes immediately after save and are you noticing if the the flicker coincides with a redirect or success toast?
Happy to look into this with you, just wanted to narrow down what the issue could be, hope to hear from you soon!