Repository navigation
fix(undefined-object): respect caller context in rendered snippets - #1373
Open
efegokdemir wants to merge 1 commit into
Open
efegokdemir wants to merge 1 commit into
efegokdemir wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you adding in this PR?
UndefinedObjectreportspredictive_searchas undefined when a snippet is rendered by a predictive-search section, even though the object is available in that caller context. This change includes contextual objects from the snippet's referencing ancestors when evaluating it. The new regression fails on the base implementation and passes with the fix; a separate case confirms an unreferenced snippet still reports the undefined object.Related to #944.
What's next? Any followup issues?
No follow-up issues identified.
What did you learn?
A snippet's valid contextual objects depend on the files that render it, so checking only the snippet path misses caller-provided Liquid context.
Tophatting
No manual tophatting was run; the behavior is covered by the regression fixtures.
Validation: 5,749
@shopify/theme-check-commontests passed (43 files); the package type-check, Prettier check for the changed TypeScript file andgit diff --checkpassed.Before you deploy
Bug fixes
changeset.