Skip to content

feat: query channels request override#1583

Merged
isekovanic merged 4 commits intomasterfrom
feat/query-channels-request-override
Jul 23, 2025
Merged

feat: query channels request override#1583
isekovanic merged 4 commits intomasterfrom
feat/query-channels-request-override

Conversation

@isekovanic
Copy link
Contributor

CLA

  • I have signed the Stream CLA (required).
  • Code changes are tested

Description of the changes, What, Why and How?

This PR introduces a way for integrators to override the default ChannelManager's queryChannels (which is essentially client.queryChannels.

This is particularly useful in certain niche' edge cases, where for example if querying channels relies heavily on { cid: { $in: [...] }} filters (or something similar) it would be impossible to properly paginate through everything as changing the filters on the fly causes the entire state to be wiped as it's considered to be a brand new query.

It also comes with a set of rules:

  • client.queryChannels must always be invoked by this override (the reason being that queryChannels additionally does a bunch of state updates under the hood, so it's mandatory that this is run)
  • The filters stay intact during all of this (if they change, the ChannelManager will consider this to be a brand new query and wipe everything)
  • The override still needs to respect limit and offset, so that pagination works properly (this comes as a given since we pin specific IDs, but worth mentioning still)

Changelog

@github-actions
Copy link
Contributor

Size Change: +194 B (+0.04%)

Total Size: 433 kB

Filename Size Change
dist/cjs/index.browser.cjs 125 kB +67 B (+0.05%)
dist/cjs/index.node.cjs 170 kB +66 B (+0.04%)
dist/esm/index.js 138 kB +61 B (+0.04%)

compressed-size-action

@isekovanic isekovanic merged commit 71e4715 into master Jul 23, 2025
4 checks passed
@isekovanic isekovanic deleted the feat/query-channels-request-override branch July 23, 2025 10:09
github-actions bot pushed a commit that referenced this pull request Jul 23, 2025
## [9.12.0](v9.11.0...v9.12.0) (2025-07-23)

### Features

* add static location and live location support ([#1423](#1423)) ([8101f65](8101f65))
* query channels request override ([#1583](#1583)) ([71e4715](71e4715))
@stream-ci-bot
Copy link

🎉 This PR is included in version 9.12.0 🎉

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.

4 participants