Check a rendered scope template against its source, for fields that RESTRICT
(ExtraFilter, MetadataFilter, ExternalIndexConfig).
This catches the two ways a restriction can evaporate during rendering, neither of which
the value alone can reveal — by the time a provider sees the constraint, the source
template has been discarded, so "authored but rendered to nothing" is indistinguishable
from "never authored":
Rendered empty.RenderScopeTemplate runs Nunjucks with throwOnUndefined: false,
so a mistyped dimension (SecondaryScopes.EffectiveChanneID) makes a {% if %} guard
false and the entire restricting clause silently disappears — the lane then runs
unrestricted. (We deliberately do NOT flip throwOnUndefined: legitimate templates
output optional dimensions, and flipping it would break them all.)
Template leaked through. On a render error RenderScopeTemplate returns the RAW
template, so {% if %}/{{ }} syntax reaches a filter as literal text.
Parameters
source: string
the un-rendered template from the scope row
rendered: unknown
the output of RenderScopeTemplate / RenderScopeJsonTemplate
Check a rendered scope template against its source, for fields that RESTRICT (
ExtraFilter,MetadataFilter,ExternalIndexConfig).This catches the two ways a restriction can evaporate during rendering, neither of which the value alone can reveal — by the time a provider sees the constraint, the source template has been discarded, so "authored but rendered to nothing" is indistinguishable from "never authored":
RenderScopeTemplateruns Nunjucks withthrowOnUndefined: false, so a mistyped dimension (SecondaryScopes.EffectiveChanneID) makes a{% if %}guard false and the entire restricting clause silently disappears — the lane then runs unrestricted. (We deliberately do NOT flipthrowOnUndefined: legitimate templates output optional dimensions, and flipping it would break them all.)RenderScopeTemplatereturns the RAW template, so{% if %}/{{ }}syntax reaches a filter as literal text.