App data metafields do not update in the front end?

The new Shopify app data metafields do not update in the front end unless a theme file for example theme.liquid is updated or the theme extension is deployed again. This totally defeats the purpose of the app metafields. So I believe this is not by design but is rather a flaw?

1 Like

Hey,

Its possible that you are viewing a cached version of your theme and so it outputs the old metafields - even though new ones are updated. That’s why it works after you change the theme.

This annoys me also.

Yes, its is cached but even after 1 hour the metafields are not there. According to the example use case in the Shopify documentation , these metafields can be used to control app subscription features. However I do not see how this is possible when these metafields do not update in the front end.

1 Like

Same issue, It break my app

I hope that Shopify can update ASAP

1 Like

Pages would never update for me if I tried to update a metafield with it, despite what is shown the 2023-07 docs. For example, in Ruby:

page = ShopifyAPI::Page.new(session: @session)
page.id = 1234
page.body_html = "

new content

"
page.metafields = [{ ... },{ ... }]
page.save!

The only way I got Pages to update was by updating the metafields in a separate call, like so:

page = ShopifyAPI::Page.new(session: @session)
page.id = 1234
page.body_html = "

new content

"
page.save!

metafield = ShopifyAPI::Metafield.new(session: @session)
metafield.page_id = 1234
metafield.namespace = "namespace"
metafield.key = "key"
metafield.value = "new value"
metafield.type = "single_line_text_field"
metafield.save!