stream-chat-android
stream-chat-android copied to clipboard
[AND-421] Message Reminders
๐ฏ 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 (remindAttime) 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.reminderfield - 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 byMessageRemindersComponentFactory
๐จ UI Changes
| Query Reminders | Create/Edit/Delete |
|---|---|
๐งช Testing
- Contact me on Slack to provide a testing patch (contains credentials)
TODO:
- [x] Verify nullability of
MessageReminder.messageandMessageReminder.channelfields - [x] Verify handling of
ReminderEventsinChannelLogicandEventHandlerSequential - [x] Verify the structure of
ReminderEvents- check if it can becomeCidEventand maybe mark it asHasReminder - [x] Verify filtering/sorting logic against BE
- [x] Add ChannelConfig flag
- [ ] Handle notification.reminder_due PN
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
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 | ๐ข |
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 ๐๐ป
