Skip to content

fix: query reminders filter key and add channel to the reminder response#1575

Merged
khushal87 merged 1 commit intomasterfrom
fix/reminders-filter-key
Jul 7, 2025
Merged

fix: query reminders filter key and add channel to the reminder response#1575
khushal87 merged 1 commit intomasterfrom
fix/reminders-filter-key

Conversation

@khushal87
Copy link
Member

@khushal87 khushal87 commented Jul 1, 2025

The following are fixed/added on this PR:

  1. The curl for the reminder query is as follows:
curl -X POST "https://chat.stream-io-api.com/reminders/query?api_key=pd67s34fzpgw&user_id=luke_skywalker&connection_id=685e4531-0a15-1dfe-0200-0000000000a8" \
  -H "Content-Type: application/json" \
  -H "Content-Encoding: application/gzip" \
  -H "X-Stream-Client: stream-chat-flutter-v10.0.0-beta.2|app=ChatSample|app_version=2.2.0|os=ios 18.0|device_model=iPhone17,1" \
  -H "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoibHVrZV9za3l3YWxrZXIifQ.hZ59SWtp_zLKVV9ShkqkTsCGi_jdPHly7XNCf5T_Ev0" \
  -H "stream-auth-type: jwt" \
  --data-raw '{"filter":{"remind_at":{"$lte":"2025-06-30T12:08:56.502809Z"}},"sort":[{"field":"remind_at","direction":1}],"limit":30}'

We had the filter key as filter_conditions, which was not working, and I noticed it when working on the reminders listing page.

  1. Added a channel response to the reminder response, which was needed.
  2. Added the $exists filter key for the remind_at as the BE supports it, and we have to use it to show only "Scheduled" reminders.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2025

Size Change: -18 B (0%)

Total Size: 433 kB

Filename Size Change
dist/cjs/index.browser.cjs 125 kB -6 B (0%)
dist/cjs/index.node.cjs 169 kB -6 B (0%)
dist/esm/index.js 138 kB -6 B (0%)

compressed-size-action

Copy link

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 corrects the request payload key for querying reminders, enriches the reminder response with channel data, and expands the remind_at filter to include existence checks.

  • Renamed filter_conditions to filter in the queryReminders call
  • Added a channel property to the ReminderResponse type
  • Included the $exists operator for remind_at filters

Reviewed Changes

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

File Description
src/types.ts Added channel to ReminderResponse and included $exists in remind_at filters
src/client.ts Changed filter_conditions to filter in the POST body of queryReminders
Comments suppressed due to low confidence (4)

src/client.ts:4576

  • Update the method's JSDoc or inline comment to reference the renamed filter parameter instead of the removed filter_conditions for consistency.
  async queryReminders({ filter, sort, ...rest }: QueryRemindersOptions = {}) {

src/types.ts:4058

  • [nitpick] Consider adding a JSDoc comment for the new channel property to clarify its role and structure within ReminderResponse.
  channel: ChannelResponse;

src/types.ts:4096

  • Add or update unit/integration tests to cover the $exists filter on remind_at so scheduled reminders are correctly filtered.
          '$exists' | '$eq' | '$gt' | '$lt' | '$gte' | '$lte'

src/client.ts:4577

  • The return await is redundant here. You can return the promise directly: return this.post<...>(...) to avoid an extra microtask.
    return await this.post<QueryRemindersResponse>(`${this.baseURL}/reminders/query`, {

@khushal87 khushal87 merged commit 0b9be45 into master Jul 7, 2025
6 checks passed
@khushal87 khushal87 deleted the fix/reminders-filter-key branch July 7, 2025 13:51
github-actions bot pushed a commit that referenced this pull request Jul 8, 2025
## [9.10.1](v9.10.0...v9.10.1) (2025-07-08)

### Bug Fixes

* allow the composition of unchanged edited message ([#1578](#1578)) ([6aec136](6aec136))
* query reminders filter key and add channel to the reminder response ([#1575](#1575)) ([0b9be45](0b9be45))
@stream-ci-bot
Copy link

🎉 This PR is included in version 9.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants