Skip to content

test(persistence): pin the sort-field contract behind #1514 - #1518

Open
manan164 wants to merge 1 commit into
mainfrom
test/sort-field-contract
Open

test(persistence): pin the sort-field contract behind #1514#1518
manan164 wants to merge 1 commit into
mainfrom
test/sort-field-contract

Conversation

@manan164

Copy link
Copy Markdown
Contributor

Complements #1515, which fixes the Agent Name sort by removing a UI-side rename of workflowType to workflowName. Tests only — no production code.

The reason that bug was invisible is that nothing on the backend rejects a wrong sort field: getSort() skips anything outside VALID_FIELDS and returns "", so the query runs with no ORDER BY at all. These two tests per builder pin that behaviour — workflowType:ASC produces ORDER BY workflow_type ASC, workflowName:ASC produces no ORDER BY — so the next caller that sends an unindexed field is caught by a test rather than by unordered pages.

Passes on main as-is and stays valid after #1515 merges.

#1515 fixes the Agent Name sort by removing a UI-side rename of
`workflowType` to `workflowName`. Nothing on the backend rejected the
wrong name, which is why the bug was invisible: an unrecognised sort
field is dropped silently rather than erroring, so getSort() returned
"" and the query ran with no ORDER BY.

Pin that contract in both query builders, so a future caller sending an
unindexed field is caught by a test rather than by unordered pages:

  workflowType:ASC -> ORDER BY workflow_type ASC
  workflowName:ASC -> no ORDER BY

No production code changes; these pass on main as-is and stay valid
after #1515 merges.

Relates to #1514
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.

1 participant