Skip to content

fix(filters): correct invalid filter keys and date boundaries, validate filter keys and page mappers - #2211

Open
papistacoding wants to merge 5 commits into
mainfrom
e2e/split/filter-hardening
Open

fix(filters): correct invalid filter keys and date boundaries, validate filter keys and page mappers#2211
papistacoding wants to merge 5 commits into
mainfrom
e2e/split/filter-hardening

Conversation

@papistacoding

@papistacoding papistacoding commented Aug 29, 2026

Copy link
Copy Markdown
Member

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:

Was Now
costCenterNameContains costCenterContains
regionNameContains regionContains
dataClassificationNameIn assetDataClassificationNameIn
subtypeNameIn assetSubtypeNameIn
hasPolicies hasInternalPolicies
policyTypeIsNil internalPolicyKindNameIsNil

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openlane-ui Ready Ready Preview Aug 31, 2026 10:49pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Aug 31, 2026 10:49pm

Request Review

@papistacoding papistacoding changed the title fix(filters): correct invalid filter keys and date boundaries, valida… fix(filters): correct invalid filter keys and date boundaries, validate filter keys and page mappers Aug 29, 2026
@papistacoding
papistacoding marked this pull request as ready for review August 29, 2026 13:26
@papistacoding
papistacoding requested review from a team as code owners August 29, 2026 13:26
@papistacoding
papistacoding marked this pull request as draft August 29, 2026 14:29
@papistacoding
papistacoding force-pushed the e2e/split/filter-hardening branch from 6d9807d to d5d23ac Compare August 29, 2026 19:28
@papistacoding
papistacoding marked this pull request as ready for review August 29, 2026 19:33
Comment thread apps/console/src/components/pages/protected/tasks/table/table-config.ts Outdated
Comment thread apps/console/src/components/pages/protected/tasks/table/table-config.ts Outdated
papistacoding and others added 5 commits September 1, 2026 00:43
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants