Skip to content

fix: make predefined filters API generic and prevent dropping regular sort params if provided#1737

Merged
MartinCupela merged 3 commits intomasterfrom
feat/predefined-filters
May 8, 2026
Merged

fix: make predefined filters API generic and prevent dropping regular sort params if provided#1737
MartinCupela merged 3 commits intomasterfrom
feat/predefined-filters

Conversation

@MartinCupela
Copy link
Copy Markdown
Contributor

Goal

The original predefined filters implementation omitted DX, when it used Record<string, unknown> for filters definitions in predefined filters types. We have ChannelsFilter type that can be passed to predefined filters types to help users type the filters easier.

Also the channelsQueryRequest method was dropping regular sort parameter, if it detected predefined_filters in the methods payload. But this is incorrect in cases, when somebody wants to use predefined filter that has not sort param internally and wants to rely on dynamically provided regular sort object. If the server-side stored predefined filter definition contains its own sort, the regular sort param is ignored server-side.

I have added fixme comment so that channelsQueryRequest returns the whole response payload as it contains predefined_filters payload, that is currently being discarded and cannot be used client-side to follow sorting and filtering rules client-side. This change would be breaking and so it is not implemented with this PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Size Change: +62 B (+0.02%)

Total Size: 381 kB

📦 View Changed
Filename Size Change
dist/cjs/index.browser.js 127 kB +21 B (+0.02%)
dist/cjs/index.node.js 128 kB +20 B (+0.02%)
dist/esm/index.mjs 126 kB +21 B (+0.02%)

compressed-size-action

Comment thread src/client.ts
@MartinCupela MartinCupela merged commit c68915c into master May 8, 2026
4 checks passed
@MartinCupela MartinCupela deleted the feat/predefined-filters branch May 8, 2026 12:01
github-actions Bot pushed a commit that referenced this pull request May 8, 2026
## [9.43.2](v9.43.1...v9.43.2) (2026-05-08)

### Bug Fixes

* add command utils to public exports ([#1738](#1738)) ([30a7ece](30a7ece))
* make predefined filters API generic and prevent dropping regular sort params if provided ([#1737](#1737)) ([c68915c](c68915c))
@stream-ci-bot
Copy link
Copy Markdown

🎉 This PR is included in version 9.43.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants