dev/core#2832 Add test for legacy membership tokens, add support for preferred tokens #21453
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.
Overview
dev/core#2832 Add test for legacy membership tokens, add support for preferred tokens
Before
Less tests, more code, no support for preferred unambiguous tokens
{membership.status_id:label}
&{membership.membership_type_id:labe}
After
This is mostly about adding the tests to permit changing to the processor & ensuring no unexpected changes.
However, I've fixed the outgoing code to support the preferred unambiguous tokens.
It seems like a little extra work now but it means that we will know those tokens work consistently, even from (unsupported) outside of core calls. Also it means that if the full conversion gets too hard the existing code supports these preferred tokens
Working through that also allowed me to rdetermine the complicated code wasn't achieving anything a fixed array didn't and switching to a fixed array removed a dependency from the outgoing code to other core code.
Technical Details
There is only one place that calls this code. With cover of the legacy tokens
I can ensure it is the same as the processor tokens.
Comments