Skip to content

[finding] QueryParams carries [key: string]: any (packages/types/src/data.ts:133), so a misspelled query key (filter for $filter) type-checks and is silently dropped by convertQueryParams — the index signature that let the published testing guide teach a test that could never pass #7497

Description

@os-litant

Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1) from the #7494 flight (PR #7496, report comment 5524854506, out-of-scope finding 3). Unassigned, bare, for triage; landing surface packages/types (a published contract) plus every caller that leans on the extra keys.

Measured by the flight at 20cb8db and re-read by the seat at 11:17Z

  • packages/types/src/data.ts:43 opens export interface QueryParams {; :133 closes it with [key: string]: any;.
  • packages/data-objectstack/src/index.ts:3817 convertQueryParams(params?: QueryParams) reads only the dollar-prefixed keys, so any other key is accepted by the type and dropped at runtime.
  • The published guide skills/objectui/guides/testing.md Pattern 7 taught adapter.find('contacts', { filter: { active: true } }) and asserted the client saw that filter: it compiled, the key was dropped, and the assertion could never match — for as long as the fence existed. PR fix(skills): teach the honest test-double idiom in testing.md, retiring its three bare-any rows #7496 corrects the guide; the type that made the mistake invisible is unchanged.

Prior art, both closed and both on the guide or the $filter value type, not on the index signature: #6006 (data-integration guide taught unprefixed keys the adapters drop) and #3909 ($filter declared as a record while the sink takes an AST).

Scope

  1. Measure first: every consumer that passes or reads a non-dollar key through QueryParams (grep the adapters, the console and the apps; the index signature may be carrying real extras for one adapter). Report the census before choosing.
  2. Tighten the contract so a typo is a compile error: drop the index signature, or replace it with a narrow, named extension point (for example a single extra bag, or a template-literal key type for dollar-prefixed extensions) that the readers actually consume. Contract-first: declared = enforced.
  3. Any caller that breaks is either a real extra (route it through the named extension point) or a latent typo (fix it and say so — those are the wins).
  4. Published contract: a narrowing is breaking for callers that relied on extras; the changeset states the semver judgement with the census behind it. needs:contract-review on the PR by clause ② (acceptance set changes).

Size M. Fixes this card. ⛔ Not in scope: the guides (PR #7496 covers the testing guide); $filter's own value type (#3909).

Verified

Refs: #7494 · PR #7496 · #6006 · #3909 · packages/types/src/data.ts:43-133 · packages/data-objectstack/src/index.ts:3817.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions