Send duration on the single channel query response - #77
Merged
Merged
Conversation
gpunto
marked this pull request as ready for review
October 1, 2026 07:19
gpunto
enabled auto-merge (squash)
October 1, 2026 11:50
andremion
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
The single channel query (
POST /channels/:channel_type/:channel_id/query, and the v2 distinct channel routePOST /api/v2/chat/channels/:channel_type/query) returns the stored channel entry as-is, so the response has no top-levelduration. 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
ChannelStateResponsein GetStream/stream-chat-android#6760, wheredurationis required. Without it everyqueryChannelfails to parse on the mock.Implementation
paginate_message_listnow returns a copy of the channel entry withdurationmerged in, on both the paginated and non-paginated paths. The stored entry in$channel_listis 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 withoutmessages.limit, andPOST /channelsstill returns its recordeddurationwith nodurationon the channel entries.ruby -cand rubocop are clean.Please verify the E2E test runs:
durationnow passes;test_pushNotification_optionalValuesAreEmptyfailed once on the notification not appearing and passed on re-run.