Skip to content

Send duration on the single channel query response - #77

Merged
gpunto merged 1 commit into
mainfrom
fix/single-channel-query-duration
Oct 2, 2026
Merged

gpunto merged 1 commit into
mainfrom
fix/single-channel-query-duration

Conversation

@gpunto

@gpunto gpunto commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Goal

The single channel query (POST /channels/:channel_type/:channel_id/query, and the v2 distinct channel route POST /api/v2/chat/channels/:channel_type/query) returns the stored channel entry as-is, so the response has no top-level duration. The real backend always sends it on this response, and the channel list response already has it.

Android is switching this response to the generated ChannelStateResponse in GetStream/stream-chat-android#6760, where duration is required. Without it every queryChannel fails to parse on the mock.

Implementation

paginate_message_list now returns a copy of the channel entry with duration merged in, on both the paginated and non-paginated paths. The stored entry in $channel_list is untouched, so the channel list and later queries are unaffected. It's response metadata, so it goes on the response rather than into the recorded channels fixture.

Testing

Covered by the E2E tests that open a channel not already loaded from the list (quoted replies to messages outside the loaded page, unread messages, push notifications).

Checked against a local server: both query routes return duration: "7.11ms" with and without messages.limit, and POST /channels still returns its recorded duration with no duration on the channel entries. ruby -c and rubocop are clean.

Please verify the E2E test runs:

@gpunto
gpunto marked this pull request as ready for review October 1, 2026 07:19
@gpunto
gpunto enabled auto-merge (squash) October 1, 2026 11:50
@gpunto
gpunto merged commit 9362ca3 into main Oct 2, 2026
4 checks passed
@gpunto
gpunto deleted the fix/single-channel-query-duration branch October 2, 2026 08:53
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.

2 participants