liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Fix resource limit scores resetting on include

Open agon-qurdina opened this issue 4 years ago • 0 comments

When include is used in a template, it'll go through Liquid::Template#render, which is called on a new template instance but with the same context. Meaning the "partial" that was included will keep using & updating the same Liquid::ResourceLimits instance. Among those updates though, there is an initial, unconditional reset of the scores done inside Liquid::Template#render.

After this fix, the reset will only be applied if the method was not called inside a partial context.

agon-qurdina avatar Oct 27 '21 08:10 agon-qurdina