Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquid::Drop: Expect @context to always be set #1528

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tjoyal
Copy link
Member

@tjoyal tjoyal commented Mar 1, 2022

Liquid::Drop to always assume @context is set.

While this is the direction I think we need to take, I'm not sure this is a safe change to introduce yet until further exploration of reports regarding issues with @context being absent or reset.

I think I would still go ahead and extract these tests as a pre-PR as they better reflect the production behavior and desired code coverage.

Related to #1205 (Execution paths missing @context)

Copy link
Contributor

@dylanahsmith dylanahsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to lib/liquid/drop.rb doesn't seem like it should affect that much code, but if we want to be more cautious about breaking changes, then we could have a deprecation warning in Liquid::Drop#liquid_method_missing if @context is nil

@tjoyal
Copy link
Member Author

tjoyal commented Mar 1, 2022

if we want to be more cautious about breaking changes, then we could have a deprecation warning in Liquid::Drop#liquid_method_missing if @context is nil

👍

Since it is very hard to test for these things, it might be a good path forward to move fast and safely.

I want to iron out as much as possible this is not an issue from the gem itself and then I'll update and send it in review.

@tjoyal tjoyal force-pushed the drop/expect-context-to-be-present branch from c0ffee0 to c0ffeef Compare March 2, 2022 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants