Skip to content

Include show_in_channel thread replies in the channel query response#43

Merged
andremion merged 1 commit into
mainfrom
fix/include-show-in-channel-replies-in-channel-query
Jul 13, 2026
Merged

Include show_in_channel thread replies in the channel query response#43
andremion merged 1 commit into
mainfrom
fix/include-show-in-channel-replies-in-channel-query

Conversation

@andremion

@andremion andremion commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What

The channel query response (paginate_message_list) only returned messages with parent_id == nil, which drops thread replies sent also to the channel. The backend's channel message predicate is (parent_id IS NULL) OR (show_in_channel = true), so those replies belong in the response.

Why it matters

This surfaced as the flaky test_threadReplyIsRemovedEverywhere_whenParticipantRemovesItFromChannel on Android (AND-1303). The chain, reconstructed from the per-attempt artifacts of the 2026-07-13 nightly:

  1. The WebSocket drops mid-test on a loaded CI emulator and the client reconnects.
  2. As part of recovery, the client re-queries the channel.
  3. The response omits the also-in-channel reply, so the client (correctly, given the data) removes it from state, wiping the deleted-message placeholder the test was asserting. The placeholder was visible in the UI for 110ms before the response arrived.

The client behaved correctly; the response was the lie. Without a mid-test reconnect there is no re-query, which is why the test only flakes under CI load.

Testing

Against a local instance: seeded a regular message, a thread reply with thread_and_channel=true, and a thread-only reply, then POST /channels/messaging/{id}/query:

  • the also-in-channel reply is now in messages (the fix)
  • the thread-only reply stays excluded (no regression)
  • regular messages unaffected

The channel query response only returned messages with parent_id == nil, dropping thread replies sent also to the channel. The backend's channel message predicate is (parent_id IS NULL) OR (show_in_channel = true).

This surfaced as a flaky Android e2e test: after a mid-test WebSocket reconnect, the client re-queries the channel and the response silently removed the also-in-channel reply from its state, wiping the deleted-message placeholder the test was waiting for (AND-1303).

Verified against a local instance: an also-in-channel reply is now returned by the query, thread-only replies stay excluded.
@andremion andremion marked this pull request as ready for review July 13, 2026 12:46
@andremion

Copy link
Copy Markdown
Contributor Author

Started e2e tests on this branch:

@andremion

Copy link
Copy Markdown
Contributor Author

e2e results against this branch:

  • iOS: green across the board.
  • Android: 4 of 6 API levels green. The two failures are pre-existing known flakes, unrelated to this fix: test_originalQuoteIsDeletedByParticipant_deletedMessageIsShown_InThread (the lost-event-during-reconnect issue, see AND-1303) and test_deliveryStatusShownForPreviousMessage_whenSystemMessageShown (an assert race fixed in e2e: Fix the flaky test races and re-enable the composer giphy test stream-chat-android#6570, not yet merged when this ran).

No failures in the channel-query domain on either platform.

@andremion andremion merged commit 7797af8 into main Jul 13, 2026
4 checks passed
@andremion andremion deleted the fix/include-show-in-channel-replies-in-channel-query branch July 13, 2026 14:19
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