Skip to content

Hide message delivery status indicators when read events are disabled#6578

Merged
andremion merged 3 commits into
developfrom
andrerego/and-1309-compose-delivery-status-indicators-are-shown-when-read
Jul 23, 2026
Merged

Hide message delivery status indicators when read events are disabled#6578
andremion merged 3 commits into
developfrom
andrerego/and-1309-compose-delivery-status-indicators-are-shown-when-read

Conversation

@andremion

@andremion andremion commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Goal

When a channel's config has read_events: false, the message delivery status indicators (single and double checkmarks) should be hidden, in the message list and in the channel preview. The iOS SDK already hides them. Both our UI kits always showed the indicators.

Resolves AND-1309

Implementation

The rule mirrors the iOS SDK:

  • The pending (clock) and failed indicators are always shown.
  • The sent and read checkmarks are shown only when channel.config.readEventsEnabled is true.
  • The delivered checkmark is shown only when channel.config.deliveryEventsEnabled is true.

Compose kit:

  • MessageReadStatusIcon applies the rule in its SyncStatus.COMPLETED branch, behind two new defaulted parameters (readEventsEnabled, deliveryEventsEnabled). The channel-based overload derives them from channel.config, which covers the channel list preview.
  • MessageItemState carries the two flags to the message list footer. MessageListController fills them from the channel config, for both the channel and thread message lists.

XML kit:

  • MessageListItem.MessageItem gets the same two flags, filled by the mapper from the common MessageItemState.
  • FootnoteDecorator (message list footnote) and ChannelViewHolder (channel list preview) apply the same rule.

All new fields and parameters have defaults that keep the current behavior, so the public API changes are additive.

🎨 UI Changes

No visual changes with the default channel config. When read events are disabled for the channel, the checkmarks below own messages and in the channel preview are no longer shown.

Testing

Manual steps:

  1. Disable read events for a channel type in the Dashboard.
  2. Open a channel of that type in a sample app (Compose or UI Components) and send a message.
  3. Expected: no checkmark appears below the message after it is sent. The clock indicator still appears while the message is sending, and the error indicator still appears if sending fails.
  4. Return to the channel list. Expected: no checkmark next to the last message preview.

Evidence:

  • Removed the @Ignore annotations from the 7 e2e tests linked to AND-1309 in MessageDeliveryStatusTests. All 7 pass locally against the mock server, together with the previously passing test_deliveryStatusShowsClocks_whenMessageIsInPendingStateAndReadEventsIsDisabled.
  • New unit tests: gating behavior of MessageReadStatusIcon (Robolectric), config propagation in MessageListController, and the common-to-XML item mapping.
  • spotlessCheck, detekt, apiDump, and the unit test suites of the touched modules pass locally.

Note: e2e tests exist only for the Compose sample, so the XML kit is covered by the unit tests and the manual steps above.

Summary by CodeRabbit

  • New Features
    • Message read and delivery indicators now honor per-channel configuration for both read and delivery events.
  • Bug Fixes
    • Status icons (read/delivered/sent fallback) are now correctly suppressed when the corresponding event type is disabled.
  • Tests
    • Enabled previously skipped end-to-end delivery status scenarios.
    • Added UI and mapping coverage to verify indicator behavior under different event-enable settings.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@andremion andremion added the pr:bug Bug fix label Jul 20, 2026
@andremion

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.95 MB 5.95 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.21 MB 11.21 MB 0.00 MB 🟢
stream-chat-android-compose 12.69 MB 12.69 MB 0.00 MB 🟢

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5e8a32ed-c854-47a5-a2d1-92790d1d4f38

📥 Commits

Reviewing files that changed from the base of the PR and between d59cdfe and 89fa1be.

📒 Files selected for processing (15)
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageDeliveryStatusTests.kt
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/MessageReadStatusIcon.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/components/channels/MessageReadStatusIconBehaviorTest.kt
  • stream-chat-android-ui-common/api/stream-chat-android-ui-common.api
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/messages/list/MessageListItemState.kt
  • stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListControllerTests.kt
  • stream-chat-android-ui-components/api/stream-chat-android-ui-components.api
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/channels/list/adapter/viewholder/internal/ChannelViewHolder.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/MessageListItem.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/decorator/internal/FootnoteDecorator.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/utils/extensions/MessageListItem.kt
  • stream-chat-android-ui-components/src/test/kotlin/io/getstream/chat/android/ui/utils/extensions/MessageListItemMappingTest.kt
💤 Files with no reviewable changes (1)
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageDeliveryStatusTests.kt
🚧 Files skipped from review as they are similar to previous changes (7)
  • stream-chat-android-ui-components/src/test/kotlin/io/getstream/chat/android/ui/utils/extensions/MessageListItemMappingTest.kt
  • stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListControllerTests.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/MessageReadStatusIcon.kt
  • stream-chat-android-ui-components/api/stream-chat-android-ui-components.api
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/decorator/internal/FootnoteDecorator.kt

📝 Walkthrough

Walkthrough

Channel read and delivery event flags now flow from channel configuration into message item state and Compose and classic UI status indicators. Disabled event types suppress corresponding icons, with unit, Compose, mapping, and end-to-end coverage.

Changes

Event status visibility

Layer / File(s) Summary
State propagation and public contracts
stream-chat-android-ui-common/..., stream-chat-android-ui-components/api/...
Message state and UI items expose read and delivery event flags populated from channel configuration with true defaults.
Classic UI rendering
stream-chat-android-ui-components/src/main/kotlin/...
Message footers and channel-list status icons conditionally hide read, delivered, or sent indicators.
Compose rendering
stream-chat-android-compose/src/main/..., stream-chat-android-compose/api/...
MessageReadStatusIcon accepts event flags and conditionally renders completed-state indicators.
Validation
stream-chat-android-ui-common/src/test/..., stream-chat-android-ui-components/src/test/..., stream-chat-android-compose/src/test/..., stream-chat-android-compose-sample/src/androidTestE2eDebug/...
Tests verify propagation, mapping, Compose icon visibility, and previously ignored end-to-end scenarios.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: pr:improvement, pr:test

Suggested reviewers: velikovpetar, gpunto

Sequence Diagram(s)

sequenceDiagram
  participant ChannelConfig
  participant MessageListController
  participant MessageItem
  participant StatusIndicator
  ChannelConfig->>MessageListController: provide read and delivery event flags
  MessageListController->>MessageItem: store event enablement
  MessageItem->>StatusIndicator: pass flags with message status
  StatusIndicator-->>MessageItem: render or hide corresponding icon
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed It clearly states the main behavior change: hiding message delivery indicators when read events are disabled.
Description check ✅ Passed It covers Goal, Implementation, UI Changes, and Testing; only non-critical checklist and GIF sections are missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch andrerego/and-1309-compose-delivery-status-indicators-are-shown-when-read

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/MessageReadStatusIcon.kt`:
- Around line 104-108: Update the SyncStatus.COMPLETED branch in the message
read-status icon logic so read and delivered conditions also require their
corresponding events to be enabled. This must allow execution to fall through to
the next eligible indicator, including the sent icon when neither enabled
condition matches; preserve the existing icon helpers and status priority.

In
`@stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/channels/list/adapter/viewholder/internal/ChannelViewHolder.kt`:
- Around line 363-369: Update the status-indicator fallback logic in
ChannelViewHolder.kt lines 363-369 so disabled higher-state events fall through
to the next available indicator instead of returning null; preserve the existing
priority order. Apply the same logical && fallback pattern to the
SyncStatus.COMPLETED handling in FootnoteDecorator.kt lines 392-396.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ce758ed0-4ef7-412b-81c5-b8b121cfec21

📥 Commits

Reviewing files that changed from the base of the PR and between f4e7c55 and d59cdfe.

📒 Files selected for processing (15)
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageDeliveryStatusTests.kt
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/MessageReadStatusIcon.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/components/channels/MessageReadStatusIconBehaviorTest.kt
  • stream-chat-android-ui-common/api/stream-chat-android-ui-common.api
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/messages/list/MessageListItemState.kt
  • stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListControllerTests.kt
  • stream-chat-android-ui-components/api/stream-chat-android-ui-components.api
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/channels/list/adapter/viewholder/internal/ChannelViewHolder.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/MessageListItem.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/decorator/internal/FootnoteDecorator.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/utils/extensions/MessageListItem.kt
  • stream-chat-android-ui-components/src/test/kotlin/io/getstream/chat/android/ui/utils/extensions/MessageListItemMappingTest.kt
💤 Files with no reviewable changes (1)
  • stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageDeliveryStatusTests.kt

@andremion
andremion marked this pull request as ready for review July 20, 2026 11:50
@andremion
andremion requested a review from a team as a code owner July 20, 2026 11:50
@andremion
andremion force-pushed the andrerego/and-1309-compose-delivery-status-indicators-are-shown-when-read branch from d59cdfe to 89fa1be Compare July 20, 2026 11:57
@andremion
andremion enabled auto-merge (squash) July 20, 2026 12:07
@sonarqubecloud

Copy link
Copy Markdown

@andremion
andremion merged commit 7e057ec into develop Jul 23, 2026
23 of 24 checks passed
@andremion
andremion deleted the andrerego/and-1309-compose-delivery-status-indicators-are-shown-when-read branch July 23, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants