stream-chat-android icon indicating copy to clipboard operation
stream-chat-android copied to clipboard

[AND-421] Message Reminders

Open VelikovPetar opened this issue 6 months ago โ€ข 3 comments

๐ŸŽฏ 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

๐Ÿงช Testing

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

TODO:

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

VelikovPetar avatar May 16 '25 10:05 VelikovPetar

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/channelconfig/internal/ChannelConfigEntity.kt
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

github-actions[bot] avatar May 16 '25 10:05 github-actions[bot]

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.40 MB 0.02 MB ๐ŸŸข
stream-chat-android-ui-components 10.43 MB 10.45 MB 0.02 MB ๐ŸŸข
stream-chat-android-compose 12.54 MB 12.56 MB 0.03 MB ๐ŸŸข

github-actions[bot] avatar May 16 '25 10:05 github-actions[bot]

Good job, @VelikovPetar ๐Ÿ‘๐Ÿป

I found this during my testing. The reminders UI is gone if we leave and enter a channel with reminders

reminders.bug.webm

It's a BE bug. I will wait until they have it fixed so I can continue testing ๐Ÿ™๐Ÿป

andremion avatar Jul 04 '25 07:07 andremion

Quality Gate Failed Quality Gate failed

Failed conditions
42.8% Coverage on New Code (required โ‰ฅ 80%)

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Jul 11 '25 17:07 sonarqubecloud[bot]