feat(reminder): add expires_at to message reminders - #273
Merged
Merged
Conversation
Reminders can now carry an expiry. Once it passes, the reminder is hidden from every read and stops counting against the per-user cap. Reminder, ReminderCreateRequest and ReminderUpdateRequest gain expiresAt; filtering on expires_at already works through the filter map. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
CHA-4375
Problem
Users who bookmark a lot of messages run into the per-user reminder cap. The API now accepts an optional
expires_aton reminders (GetStream/chat#17347): once it passes, the reminder is hidden from every read, updating or deleting it returns 404, and it no longer counts against the cap. This SDK can't send the field, and it drops the value from responses intoadditionalFields.Solution
Remindergets a typedexpiresAt(expires_at).Reminder.createReminder(...)andReminder.updateReminder(...)builders take.expiresAt(Date).remind_atandexpires_at, so a field left unset is cleared (the server's existing full-replacement behaviour)..filterCondition("expires_at", Map.of("$lt", date)).expires_atcan't be used for sorting.docs/messages/message_reminders.mdgets an expiry section and listsexpires_atas a filter.When unset, the field is serialized as
"expires_at": null, the same wayremind_atalready is. The server reads null as "never expires" and doesn't reject the key, so a new SDK against an older server behaves as before.Server rules (enforced by the API):
expires_atmust be at least one minute in the future and, whenremind_atis set, later thanremind_at.How to verify
./gradlew test --tests '*ReminderExpiresAtTest*'passes (4 tests, no API credentials needed). They check that create and update sendexpires_atin the client's date format, that an unset value is sent as null, and that a response'sexpires_atgoes into the typed field and not intoadditionalFields../gradlew spotlessCheckpasses.There are no live API tests for
expires_atyet: the server change isn't in a production release, and this repo's integration tests run against the live API. They can be added once the release ships.🤖 Generated with Claude Code