Admin UI Extension not re-rendering and not updating data on Discount Navigation

Hi everyone, I have an issue with Admin UI Extension for Discounts, i’m using this target: 'admin.discount-details.function-settings.render' and i’m using the discount function.

Now I have this api version: api_version = "2024-10" for Admin UI Extension, I’ve already try with the last version, but the issue still.

The problem is that when I navigate between differents discounts, the information in the inputs that i’ve created is the same that the last discount that I just saw, and when refresh the page, is updated.

For example, when I get inside a discount, I see the value of 40%, I get out without doing any change, I get in another one, and I get the same data than the previous one, 40.
Checking the logs, the page is not re-rendering even when I’m navigation, so the useApi is not being fired when it should/

I need a re-rendering for each one discount. Same thing happen when I’m trying to create a new discount with the app, if before that I just saw an existent discount, now the inputs in create discount is filled with the last discount that I saw before.

How can I resolve this?
Thanks.

Hi @Marisa_Roude, were you able to resolve this issue?

Hi @shopdev, no, the problem continues

@shopdev @Marisa_Roude we are having the exact same issue. On the Discount details page target admin.discount-details.function-settings.render, my Admin UI extension shows stale data when I navigate between discounts. The extension worker doesn’t re-render, useApi() doesn’t update and the data provided by this hook is stale.

This leads to wrong values displayed (and risk of writing incorrect metafields) when merchants switch from Discount A → back → Discount B.

Our current work-around for this is to literally show this as a UI on the extension and tell the user to refresh the page if the discount codes do not match. We would really appreciate any help in fixing this issue!

Also piling on here— experiencing the same thing. Save the discount, app refreshes, shows wrong value. Refresh the page, correct value.

Please escalate this to engineering as it’s a regression

1 Like

Hi folks,

Thanks for flagging - the relevant team is currently working on a fix for this.

6 Likes

Thank you for your help, @Liam-Shopify! Is there a timeline for when we can expect a resolution?

We’re experiencing the same issue. All the discounts are showing the same values.
If we refresh the app or open the discount in new tab, the correct value will be appreared.
As our system will be delivered to client on the next month - Then this is a critical issue. Please update once you fix it.

Hi folks - we’re still working on this issue. Will update here once it’s resolved - appreciate your patience on this.

Experiencing same issue as well.

As others have mentioned, I am also not able to view the correct state after saving. It will always display the initial state - a manual refresh will make it display the correct state.

Most likely same underlying issue though.

3 Likes

Also experiencing this issue with the UI extension for a discount function. Enter new values, save, page refreshes with stale values. Full browser refresh gets you the correct values. Also happens when you navigate to a different discount, stale values persist until the browser is refreshed.

Is a fix close?

not yet. I’m experiencing the same issue. This wasn’t the case a few months ago. But after revisiting today, I had thought something was wrong with the way I was setting up my admin ui block

1 Like

Hi folks - this is still an open issue, I have reconnected with the team. When I have an update I’ll post it here.

1 Like

Hello @Liam-Shopify ,
Any update on this issue ? we are also facing similar issue.
Thanks.

Just looking into this in more detail. It looks like a useMemo (or similar) issue, here’s a quick video of the issue:

Hi folks - updating here that we’re actively working on a fix for this. I’ll post here once this is shipped.

4 Likes

Adding to this issue as I didn’t see anyone else mention it - we are seeing very similar behavior on the draft order page with admin action.
Post action, the page doesn’t update with new values - the customer has to refresh (sometimes more than once) in order to see that the action worked.
In the stale state, if the customer updates anything it will save that state and overwrite the changes we made.

We had issues with this with our old admin link, and were told updating to admin actions would fix it.

Thanks!

Hi Liam, is there any updates on this fix yet? Thank you