Skip to content

fix(eager): Fix RenderFilter's handling of deferred values#1258

Merged
jasmith-hs merged 3 commits intomasterfrom
fix-render-filter-deferred-values
Feb 24, 2026
Merged

fix(eager): Fix RenderFilter's handling of deferred values#1258
jasmith-hs merged 3 commits intomasterfrom
fix-render-filter-deferred-values

Conversation

@jasmith-hs
Copy link
Contributor

Currently when using |render filter and encountering a DeferredValue as part of the interpreter.renderFlat, a DeferredToken will be created and the output will be correct, but it will lose the indication that there was a deferred value.

Similar to #920

{% set foo = "Hi {{ search_term|escape }}" %}
{{ foo|render|escape_jinjava }}

Currently results in:

Hi {{ filter:escape.filter(search_term, ____int3rpr3t3r____) }}

Because RenderFilter did not have any indication that the filter chain could not keep going. This is fixes as a DeferredInvocationResollutionException is now thrown. This results in the rendered value getting stored in a temporary value and substituted for the |render filter.

I also replaced some usages of DeferredParsingException with DeferredValueException in this PR because those usages didn't do anything beneficial and removing that logic makes the code ever so slightly less complex.

@jasmith-hs jasmith-hs changed the title Fix RenderFilter's handling of deferred values fix(eager): Fix RenderFilter's handling of deferred values Feb 24, 2026
@jasmith-hs jasmith-hs merged commit d7dc652 into master Feb 24, 2026
7 checks passed
@jasmith-hs jasmith-hs deleted the fix-render-filter-deferred-values branch February 24, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants