fix(filters): correct invalid filter keys and date boundaries, validate filter keys and page mappers - #2211
Open
papistacoding wants to merge 5 commits into
Open
fix(filters): correct invalid filter keys and date boundaries, validate filter keys and page mappers#2211papistacoding wants to merge 5 commits into
papistacoding wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
papistacoding
marked this pull request as ready for review
August 29, 2026 13:26
This was referenced Aug 29, 2026
papistacoding
marked this pull request as draft
August 29, 2026 14:29
papistacoding
force-pushed
the
e2e/split/filter-hardening
branch
from
August 29, 2026 19:28
6d9807d to
d5d23ac
Compare
papistacoding
marked this pull request as ready for review
August 29, 2026 19:33
…te filter keys and page mappers Signed-off-by: papistacoding <bruno.papista@gmail.com>
…DA coercion suite, drop the inert-key allowlist
A date range was emitted as two separate `and` entries. For a flat field
that is the same predicate, but `mapQuestionnaireFilterKey` wraps each
`dueDate*` key in its own `hasAssessmentResponsesWith`, and ent applies
every predicate of one `HasAssessmentResponsesWith` inside a single
`HasNeighborsWith` subquery. Two entries therefore became two independent
EXISTS: a questionnaire with one response due before the window and
another due after it matched a range containing none of its responses.
`handleDateEQOperator` and `handleDateRangeOperator` now emit both bounds
as one condition, and `whereGenerator` merges mapper output per entry
instead of `Object.assign`, concatenating arrays when two keys map to the
same target key. That also closes a silent drop: previously the second
mapper result overwrote the first with no error.
The coercion suite named `TrustCenterNdaRequestWhereInput`, the generated
TypeScript name; the schema type is `TrustCenterNDARequestWhereInput`. The
suite had been skipping with a "re-run codegen" warning that pointed at
the wrong cause. It runs now.
A mapper returning `{}` yields `{and: [{}]}`, which the backend rejects
with `empty predicate <T>: field 'and'` even alongside valid filters, so
the `inertKeys` allowlist asserted the wrong invariant. Both documentation
tables now hide the two control-scoped keys through
`withoutControlScopedFilters` and reuse the main pages' mappers;
`mapDocumentationProceduresFilterKey` was byte-identical to
`mapProceduresFilterKey` and the policies one differed only in the dead
branch, so `documentation-filter-mappers.ts` is gone. The suite now
asserts that every offered filter reaches the query.
Verified by replaying all 310 filter clauses, 12 searchField disjunctions
and 9 inline quick filters as real queries against a local core instance:
310/310 and 21/21, no errors.
Signed-off-by: papistacoding <bruno.papista@gmail.com>
toUtcDayStart reads as "midnight UTC", but the function returns the start of the viewer's LOCAL day expressed as a UTC instant. That is the same confusion that produced the original bug, where local midnight was relabelled as UTC rather than converted. No behaviour change. Signed-off-by: papistacoding <bruno.papista@gmail.com>
Completed now matches WONT_DO alongside COMPLETED, and Overdue and Due This Week exclude both terminal statuses -- a finished task is not overdue. Reuses TASK_TERMINAL_STATUSES rather than repeating the pair. Signed-off-by: papistacoding <bpapista@theopenlane.io>
papistacoding
force-pushed
the
e2e/split/filter-hardening
branch
from
August 31, 2026 22:46
50d1761 to
f93444c
Compare
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.
this fixes are mostly making sure our filters work without any issues and we made it from generic to type safe, so if filters change on backend we will capture errors, also safe from typos.
while writing tests, we found a couple of non-existing keys:
costCenterNameContainscostCenterContainsregionNameContainsregionContainsdataClassificationNameInassetDataClassificationNameInsubtypeNameInassetSubtypeNameInhasPolicieshasInternalPoliciespolicyTypeIsNilinternalPolicyKindNameIsNil