Repository navigation
fix(core): a revisited scope with a new policy include no longer throws - #767
Merged
Merged
Conversation
ctxSeenHandler indexed aspectValues at every new index of aspects, but processSingleResolve passes policy and schema include keys in aspects with no matching value. Since #753 routes those through a revisit, a new one read past the end of aspectValues. Supplement only the new indices that carry a value; the keys are still recorded as seen.
…lues ctx-seen took two parallel lists that were not the same length and paired them by index. It now takes the keys alone and returns the new ones. The schema resolve selects the include aspects among them, so a policy or schema include key has no value to look up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since #753, a config can stop evaluating with:
Cause.
processSingleResolve(policy/schema.nix) sendsctx-seentwo lists that the handler indexes in parallel, but they aren't the same length:aspectsis the identity keys ofincludeAspects ++ policyIncludes ++ resolveIncludes;aspectValuesisincludeAspectsalone.ctxSeenHandlercomputes the new indices overaspects, then readsaspectValuesat the same indices. When a revisited scope brings a new policy or schema include, that index is past the end ofaspectValues. The mismatch is older than #753; #753 is the first change that routes non-empty policy or schema includes through a revisit.Fix.
ctx-seenno longer takes values. It dedups keys only and returnsnewAspectIds; the schema resolve selects the new aspects fromincludeAspectsby key. Policy and schema include keys are still recorded as seen, so dedup is unchanged, and they are still never supplemented. With no second list there's nothing to index past.Supplementing the policy includes too would be wrong: the supplemental resolution then re-applies them, and a config gets duplicate definitions (a unique option defined three times).
Validation
c5.fx-handlers.test-ctx-seen-reports-new-keys: revisits of one scope key report only the keys not yet recorded.