liquid icon indicating copy to clipboard operation
liquid copied to clipboard

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

Open tjoyal opened this issue 2 years ago • 1 comments

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 https://github.com/Shopify/liquid/issues/1205 (Execution paths missing @context)

tjoyal avatar Mar 01 '22 16:03 tjoyal

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 avatar Mar 01 '22 19:03 tjoyal