Skip to content

feat(reminder): add expires_at to message reminders - #273

Merged
slavabobik merged 1 commit into
mainfrom
feature/cha-4375-reminder-expires-at
Sep 25, 2026
Merged

slavabobik merged 1 commit into
mainfrom
feature/cha-4375-reminder-expires-at

Conversation

@slavabobik

Copy link
Copy Markdown
Contributor

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_at on 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 into additionalFields.

Solution

  • Reminder gets a typed expiresAt (expires_at).
  • Reminder.createReminder(...) and Reminder.updateReminder(...) builders take .expiresAt(Date).
  • The update Javadoc says the update replaces both remind_at and expires_at, so a field left unset is cleared (the server's existing full-replacement behaviour).
  • Filtering needs no change, because filters are a plain map: .filterCondition("expires_at", Map.of("$lt", date)). expires_at can't be used for sorting.
  • docs/messages/message_reminders.md gets an expiry section and lists expires_at as a filter.

When unset, the field is serialized as "expires_at": null, the same way remind_at already 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_at must be at least one minute in the future and, when remind_at is set, later than remind_at.

How to verify

  1. ./gradlew test --tests '*ReminderExpiresAtTest*' passes (4 tests, no API credentials needed). They check that create and update send expires_at in the client's date format, that an unset value is sent as null, and that a response's expires_at goes into the typed field and not into additionalFields.
  2. ./gradlew spotlessCheck passes.

There are no live API tests for expires_at yet: 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

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>
@slavabobik
slavabobik merged commit 86407e3 into main Sep 25, 2026
5 checks passed
@slavabobik
slavabobik deleted the feature/cha-4375-reminder-expires-at branch September 25, 2026 08:43
@github-actions github-actions Bot mentioned this pull request Sep 25, 2026
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