Skip to content

feat: add message/channel paginator stack with thread minimal-init and state stores#1674

Open
MartinCupela wants to merge 32 commits intomasterfrom
feat/message-paginator
Open

feat: add message/channel paginator stack with thread minimal-init and state stores#1674
MartinCupela wants to merge 32 commits intomasterfrom
feat/message-paginator

Conversation

@MartinCupela
Copy link
Contributor

@MartinCupela MartinCupela commented Jan 12, 2026

Summary

This PR is a broader SDK architecture update, not just a message pagination introduction.
In addition to the new paginator stack, it introduces minimal Thread initialization (without initial server thread payload), reactive StateStore-based state in ChannelState, new orchestration/event-pipeline utilities, and compatibility-oriented API additions.

What’s included

1) New pagination foundation + message pagination

  • Introduces the new paginator system under src/pagination/paginators/*:
    • BasePaginator
    • ChannelPaginator
    • MessagePaginator
    • MessageReplyPaginator
    • ReminderPaginator
  • Adds supporting pagination utilities:
    • filter/sort compilers
    • cursor derivation helpers
    • index + normalization utilities
  • Adds MessagePaginator integration for channel and thread flows:
    • reply querying through paginator
    • message focus signal support
    • ingest/update/delete/reaction/truncation handling
    • jump-to-message state emission fixes

2) Multi-list channel orchestration

  • Adds ChannelPaginatorsOrchestrator for managing multiple channel lists/paginators.
  • Adds EventHandlerPipeline for composable/ordered event handling.
  • Supports ownership strategies when a channel matches multiple paginators (including priority-based ownership).
  • Handles list updates/removals/re-emits across relevant channel events.

3) Thread minimal-init support (no initial thread payload required)

  • Thread constructor now supports initialization from:
    • client + channel + parentMessage (with optional draft)
    • or existing threadData
  • Enables creating a usable thread instance before full hydration.
  • Keeps reload/hydration and pagination bootstrap behavior available after creation.
  • Includes broader thread event/state synchronization updates (participants/reply count/read/replies).

4) Reactive ChannelState stores

  • Adds StateStore-backed reactive slices in ChannelState:
    • watchers
    • typing
    • read
    • members (+ member count sync)
    • own capabilities
    • muted users
  • Preserves existing access patterns while introducing store-backed updates.

5) Message operations + local update flows

  • Adds MessageOperations and MessageOperationStatePolicy.
  • Adds/expands optimistic local update APIs for Channel/Thread message actions:
    • send
    • retry
    • update
    • delete
  • Adds message send retry cache behavior and related test coverage.

6) Config/setup and request customization improvements

  • Introduces and exports InstanceConfigurationService.
  • Moves setup/config state handling to dedicated configuration module and root exports.
  • Adds custom mark-read request support for both Channel and Thread.
  • Removes thread parameter from Channel custom mark-read request signature.

7) Compatibility-focused changes

  • Adds backward-compatible paginator aliases/APIs to reduce migration friction.
  • Preserves root-export compatibility for moved types/services.
  • Includes compatibility validation against stream-chat-react@release-v13 (tests and typecheck passing in linked validation).

Testing

Large test expansion and updates across:

  • paginator units (Base, Channel, Message, MessageReply, compiler/index utilities)
  • orchestrator + event pipeline
  • channel/channel_state/thread behaviors
  • message operations + delivery tracking
  • composer/text composer interactions
  • merge utility behavior

Notes

  • This PR is intentionally additive but broad; review by area (pagination core, channel/thread integration, reactive state, compatibility) is recommended.
  • The compatibility layer is included to keep downstream adoption smoother while enabling the new paginator model.

Todo

  • internal docs
  • docs
@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

Size Change: +95.7 kB (+26.25%) 🚨

Total Size: 460 kB

Filename Size Change
dist/cjs/index.browser.js 153 kB +31.9 kB (+26.29%) 🚨
dist/cjs/index.node.js 155 kB +32 kB (+26.09%) 🚨
dist/esm/index.mjs 152 kB +31.8 kB (+26.39%) 🚨

compressed-size-action

@MartinCupela MartinCupela marked this pull request as ready for review March 5, 2026 15:43
@MartinCupela MartinCupela changed the title WIP: feat: add reactive message pagination feat: add reactive message pagination Mar 5, 2026
@MartinCupela MartinCupela changed the title feat: add reactive message pagination feat: add message/channel paginator stack with thread minimal-init and state stores Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant