Skip to content

[AND-421] Message Reminders #5779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft

Conversation

VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented May 16, 2025

🎯 Goal

Introduces the "Message Reminders" feature to the low-level client SDK.
Allows creating/updating/deleting reminders for messages for which the user will be notified in the future, or saving a message as a bookmark (reminder without due date). It also allows querying of existing reminders, for the purpose of building lists where the users could have an overview of all saved messages.

Additionally, it introduces an example in the Compose sample app, serving as a guideline on how a reminders screen could be built using the LLC operations.

Specs: https://www.notion.so/stream-wiki/CHA-530-Snooze-message-remind-me-1886a5d7f9f6803abff5c271ad651d22

🛠 Implementation details

SDK

  • Add ChatClient.createReminder - operation for creating a new message reminder / saving a message for later

  • Add ChatClient.updateReminder - operation for updating the due date (remindAt time) for an existing reminder

  • Add ChatClient.deleteReminder - operation for deleting an existing reminder

  • Add ChatClient.queryReminders - operation for querying existing reminders

  • Add ReminderCreateEvent - event delivered when a new reminder is created

  • Add ReminderUpdatedEvent - event delivered when a reminder is updated

  • Add ReminderDeletedEvent - event delivered when a reminder is deleted

  • Add NotificationReminderDueEvent - event delivered when a reminder is due

  • Add Message.reminder field - holds information about the reminder set for the message (stored in DB as well)

Note: No real offline support is introduced for reminders, since we don't provide any state/UI for the reminders (other than the enhancement of the Message object), and the main functionality of the reminder is a push notification delivered when the reminder is due. We could introduce something like optimistic creations/updates/deletion of the reminders, but I don't think it makes too much sense, as the reminder wouldn't make sense if it is created on the BE after its due date.

Sample App

  • Add new side navigation drawer to the ChannelsActivity - it is now aligned with the XML sample + provides a new link to the Reminders screen
  • Add new "Reminders" screen where the user can filter between overdue, upcoming, saved for later...
  • They can delete or change the due date of the reminder by long-pressing the reminder items
  • They can create/update reminders directly from the MessageList - Ui created by MessageRemindersComponentFactory

🎨 UI Changes

Query Reminders Create/Edit/Delete
query-reminders.mp4
create-edit-delete-reminders.mp4

🧪 Testing

  1. Contact me on Slack to provide a testing patch (contains credentials)

TODO:

  • Verify nullability of MessageReminder.message and MessageReminder.channel fields
  • Verify handling of ReminderEvents in ChannelLogic and EventHandlerSequential
  • Verify the structure of ReminderEvents - check if it can become CidEvent and maybe mark it as HasReminder
  • Verify filtering/sorting logic against BE
  • Add ChannelConfig flag
  • Handle notification.reminder_due PN

PetarVelikov added 8 commits May 9, 2025 16:31
# Conflicts:
#	stream-chat-android-client/src/main/java/io/getstream/chat/android/client/ChatClient.kt
#	stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api/ChatApi.kt
#	stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/MoshiChatApi.kt
#	stream-chat-android-core/src/testFixtures/kotlin/io/getstream/chat/android/Mother.kt
Copy link
Contributor

DB Entities have been updated. Do we need to upgrade DB Version?
Modified Entities :

stream-chat-android-offline/src/main/java/io/getstream/chat/android/offline/repository/domain/message/internal/MessageEntity.kt
stream-chat-android-offline/src/main/java/io/getstream/chat/android/offline/repository/domain/message/internal/ReplyMessageEntity.kt

Copy link
Contributor

github-actions bot commented May 16, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.16 MB 3.18 MB 0.02 MB 🟢
stream-chat-android-offline 3.38 MB 3.39 MB 0.02 MB 🟢
stream-chat-android-ui-components 7.93 MB 7.94 MB 0.02 MB 🟢
stream-chat-android-compose 12.46 MB 12.48 MB 0.02 MB 🟢

PetarVelikov added 8 commits May 16, 2025 13:12
# Conflicts:
#	stream-chat-android-client/src/main/java/io/getstream/chat/android/client/di/BaseChatModule.kt
#	stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/list/ChannelsActivity.kt
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
61.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@VelikovPetar VelikovPetar requested a review from Copilot May 29, 2025 09:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the "Message Reminders" feature to the Android client SDK, enabling creation, updating, deletion, and querying of message reminders (including bookmark type reminders without a due date). Key changes include new API endpoints and corresponding event types, mapping functions, and updated test cases verifying these operations.

Reviewed Changes

Copilot reviewed 58 out of 58 changed files in this pull request and generated no comments.

File Description
ChatClientRemindersApiTests.kt Added tests for creating, updating, deleting, and querying reminders.
EventAdapter.kt & EventMapping.kt Integrated new reminder event adapters and domain mappings.
DomainMapping.kt & Related DTO/Request/Response Files Introduced new models, endpoints, and converters for reminder functionality.
BaseChatModule.kt, MoshiChatApi.kt, ChatApi.kt, ChatClient.kt, API Spec Updated dependency injection and API interfaces to support reminders API operations.
Comments suppressed due to low confidence (1)

stream-chat-android-client/src/test/java/io/getstream/chat/android/client/ChatClientRemindersApiTests.kt:0

  • Consider adding a test case for creating a bookmark reminder (i.e. when 'remindAt' is null) so that the bookmarking functionality is explicitly validated.
File scope

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.

1 participant