Skip to content

feat: remove hard-coded pagination defaults and align mentions pagination behavior#1694

Open
oliverlaz wants to merge 1 commit intomasterfrom
remove-hardcoded-limits
Open

feat: remove hard-coded pagination defaults and align mentions pagination behavior#1694
oliverlaz wants to merge 1 commit intomasterfrom
remove-hardcoded-limits

Conversation

@oliverlaz
Copy link
Copy Markdown
Member

@oliverlaz oliverlaz commented Feb 23, 2026

CLA

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

Description of the changes, What, Why and How?

This PR removes hard-coded pagination defaults from stream-chat-js request flows so pagination behavior follows externally provided limits and server-side defaults.

What changed:

  • Removed hard-coded constants for query-channel and query-channels message page sizes.
  • Updated pagination call sites to pass requestedPageSize only when an external limit is provided.
  • Updated messageSetPagination internals to handle optional page size:
    • infer page size from returned page when no explicit limit is provided,
    • treat non-empty pages as "has more" when page size is unknown,
    • preserve existing behavior when explicit limits are provided.
  • Updated mentions search logic to avoid MAX_CHANNEL_MEMBER_COUNT_IN_CHANNEL_QUERY assumptions:
    • allMembersLoadedWithInitialChannelQuery now compares loaded members with channel.data.member_count.
  • Updated/added tests to cover these behaviors, including focused mentions tests for missing/mismatched member_count and BaseSearchSource mute filtering path.

Changelog

  • Remove hard-coded message pagination defaults from channel/client query flows.
  • Remove hard-coded max member-count constant from mentions local/remote decision.
  • Add focused mentions pagination tests for member_count-driven behavior and pipeline filtering.

@oliverlaz oliverlaz changed the title Remove hard-coded pagination defaults and align mentions pagination behavior feat: Remove hard-coded pagination defaults and align mentions pagination behavior Feb 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Size Change: -249 B (-0.07%)

Total Size: 365 kB

Filename Size Change
dist/cjs/index.browser.js 121 kB -82 B (-0.07%)
dist/cjs/index.node.js 123 kB -82 B (-0.07%)
dist/esm/index.mjs 121 kB -85 B (-0.07%)

compressed-size-action

Copy link
Copy Markdown
Contributor

@isekovanic isekovanic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this as extensively as I could, with a variety of edge cases. I cannot notice anything wrong in particular.

The next step would be to test this on a staging app/shard and see how it works in action.

Thanks !

@isekovanic isekovanic changed the title feat: Remove hard-coded pagination defaults and align mentions pagination behavior feat: remove hard-coded pagination defaults and align mentions pagination behavior Feb 24, 2026
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.

3 participants