Available_if on App Block removes section from theme instead of just hiding it?

Hi everyone,

I’m facing a confusing issue with available_if in Shopify app blocks and wanted to understand if this is expected behavior or if I’m missing something.

I have a Shopify app block where I’m using the available_if property to control visibility based on a metafield. The metafield is updated dynamically based on the merchant’s billing status.

{% schema %}
{
  "name": "Section name",
  "target": "section",
  "available_if": "{{ app.metafields.namespace.app_enabled }}",
  "settings": []
}
{% endschema %}

  • When app_enabled = true, the app block is visible and works fine.
  • When app_enabled = false, the app block becomes unavailable (which is expected).

When app_enabled changes from falsetrue (for example, after the merchant upgrades their plan), the section is completely removed from the theme. The merchant has to manually go to the theme editor and re-add the app block again.

What I expected:

  • available_if = false → block is hidden / disabled
  • available_if = true → block becomes visible again in the same place

Instead, Shopify seems to permanently remove the section from the theme once available_if becomes false.

Any guidance or best practices here would really help.

I think Shopify caches the app block or metafield. When I turn the metafield from false to true, the app block doesn’t appear immediately. Instead, it appears after a few minutes.

Imo, it makes sense if the app block isn’t visible in the same place. Shopify stores the app blocks in a template file. But the changes are not stored.