Shopify / liquid

Liquid markup language. Safe, customer facing template language for flexible web apps.
https://shopify.github.io/liquid/
MIT License
11.13k stars 1.39k forks source link

App Block Missing Data On Theme Previews When Proceeded by a Hidden Section Containing an @app Block #1797

Open v-pani opened 6 months ago

v-pani commented 6 months ago

Describe the current behavior

When a theme section containing our app block/theme extension is placed directly after a hidden section which contains an app block, liquid data is not correctly passed to our app block.

Describe the expected behavior Block liquid data should be available to the app block regardless of block/section order and customiser "visibility" status

Version information (Dawn, browsers and operating systems) Dawn Version: 13.0.1 (as well as all themes)

Chrome Version 108.0.5359.124 macOS Version 13.1

Possible solution This appears to be a bug in the Shopify liquid parser and specifically impacts offline/preview themes so possible solutions are unclear

Additional context/screenshots

Partner created issue in Dawn theme repository: https://github.com/Shopify/dawn/issues/3413

INCORRECT BEHAVIOR https://screenshot.click/23-18-83764-334.png

CORRECT BEHAVIOR https://screenshot.click/23-18-53103-15399.png

From the partner: https://partners.shopify.com/internal/organizations/183065

QUOTE:

_I'm reaching out as we've discovered a bug with Shopify's parsing of theme sections as result of an issue brought to our attention by a number of merchants using our app.

To give you a brief overview of the bug:

The specific issue this bug causes in our case (which is what merchants are reporting to us) is that due to the missing product ID value, our review app widget falls back to displaying all reviews as opposed to only those belonging to the specific product being viewed by the user.

I've reported this issue on the Dawn theme GitHub repository here: https://github.com/Shopify/dawn/issues/3413 Although admittedly, since this bug impacts all themes, that repository likely isn't the ideal place for the bug report.

It would be great to have this bug investigated and ideally resolved. Please let me know if any further information is needed._