Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,17 @@ docs/breaking-changes-v14-v15.md for the full migration guide.
* add message/channel paginator stack with thread minimal-init and state stores ([#1795](https://github.com/GetStream/stream-chat-js/issues/1795)) ([62f0507](https://github.com/GetStream/stream-chat-js/commit/62f050786dc153b89920d59aacecaf5f051fbaed))
* integrate OpenAPI generated clients ([#1760](https://github.com/GetStream/stream-chat-js/issues/1760)) ([0776bc4](https://github.com/GetStream/stream-chat-js/commit/0776bc460598a91afb91d4d04d3281a562073f13))
* v10 ([cd3141e](https://github.com/GetStream/stream-chat-js/commit/cd3141efe47b49cf83d3d58725bb8ed3b4f88f08))
## [9.54.4](https://github.com/GetStream/stream-chat-js/compare/v9.54.3...v9.54.4) (2026-10-29)

### Bug Fixes

* handle tokenProvider rejection during reconnect token refresh ([#1962](https://github.com/GetStream/stream-chat-js/issues/1962)) ([7721bd5](https://github.com/GetStream/stream-chat-js/commit/7721bd5bf6abcce9087f11d3c07f214a1d27e217))

## [9.54.3](https://github.com/GetStream/stream-chat-js/compare/v9.54.2...v9.54.3) (2026-10-28)

### Bug Fixes

* read cached channels against the query's message_limit ([#1958](https://github.com/GetStream/stream-chat-js/issues/1958)) ([bbddea0](https://github.com/GetStream/stream-chat-js/commit/bbddea0563e2473b20b05dddb0875675e7e2f953))

## [9.54.2](https://github.com/GetStream/stream-chat-js/compare/v9.54.1...v9.54.2) (2026-10-28)

Expand Down
31 changes: 31 additions & 0 deletions test/unit/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,37 @@ describe('StreamChat.queryChannels', async () => {
});
});

describe('a cached page read against the query message_limit (#1958)', () => {
it('keeps older messages loadable once the online page arrives', async () => {
const client = await getClientWithUser();
// as ChannelPaginator.preloadFirstPageFromOfflineDb does: the DB returns the newest
// `message_limit` messages, read against that limit
const [channel] = client.hydrateChannels(
[
{
...mockChannelQueryResponse,
channel: { ...mockChannelQueryResponse.channel, last_message_at: at(200) },
messages: range(191, 200),
},
],
{ offlineMode: true, skipInitialization: [] },
{ message_limit: 10 },
);
expect(channel.messagePaginator.hasMoreTail).toBe(true);

await hydrate(client, range(191, 200), 10);
expect(shownIds(channel)).toEqual(ids(range(191, 200)));
expect(channel.messagePaginator.hasMoreTail).toBe(true);

serveFrom(channel, range(1, 200));
await channel.messagePaginator.toTail();

// one page of the channel's own page size, with more left behind it
expect(shownIds(channel)).toEqual(ids(range(91, 200)));
expect(channel.messagePaginator.hasMoreTail).toBe(true);
});
});

describe('a newest page that does not connect to the loaded messages (#1930)', () => {
it('shows the newest page, and the gap can be paginated back to the loaded messages', async () => {
const client = await getClientWithUser();
Expand Down
Loading