fix(push-preferences): align chat push preference types with the API#1786
Merged
Conversation
The shipped PushPreference / ChannelPushPreference / UpsertPushPreferencesResponse types were camelCase, but the /push_preferences endpoint is entirely snake_case and the client posts the body verbatim (no case transform) - so the existing keys never reached the server, and channel_cid / user_id were missing. Re-model the chat push preference types to match the client-side OpenAPI spec (PushPreferenceInput / PushPreferencesResponse / ChannelPushPreferencesResponse), scoped to chat: - add channel_cid and user_id to PushPreference - add chat_level / chat_preferences / disabled_until / remove_disable and a ChatPreferences type; widen ChatLevelPushPreference to all|mentions|direct_mentions|all_mentions|none|default - add PushPreferencesResponse; fix UpsertPushPreferencesResponse and the push_preferences fields on ChannelAPIResponse / OwnUserBase - remove the old camelCase keys (callLevel/chatLevel/disabledUntil/ removeDisable, userPreferences/userChannelPreferences); they were silently ignored by the server Reported in GetStream/stream-chat-react-native#3341
Contributor
|
Size Change: 0 B Total Size: 409 kB ℹ️ View Unchanged
|
isekovanic
approved these changes
Jun 29, 2026
Call push notification preferences (call_level) are part of the /push_preferences API and are documented for JavaScript, so keep them on PushPreference and PushPreferencesResponse alongside the chat fields. Only feeds preferences remain out of scope.
8 tasks
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 29, 2026
## [9.48.0](v9.47.1...v9.48.0) (2026-06-29) ### Bug Fixes * **push-preferences:** align chat push preference types with the API ([#1786](#1786)) ([26c2e49](26c2e49)) * **threads:** add notification.mark_unread handler ([#1785](#1785)) ([c60134d](c60134d)), closes [#1778](#1778) ### Features * allow augmenting event types ([#1784](#1784)) ([c32f7e9](c32f7e9))
|
🎉 This PR is included in version 9.48.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
CLA
Description of the changes, What, Why and How?
What — Re-models the chat push notification preference types so they match the client-side API.
Why — Reported in GetStream/stream-chat-react-native#3341. The shipped
PushPreferencewas camelCase (callLevel,chatLevel,disabledUntil,removeDisable) and missingchannel_cid/user_id, so channel-level and server-side preferences couldn't be set type-safely. The canonical client-side OpenAPI spec (chat-openapi-clientside.yaml) shows/push_preferencesis entirely snake_case, andsetPushPreferencesposts the body verbatim (no camelCase→snake_case transform) — so the existing camelCase keys never reached the server.How — Aligned to
PushPreferenceInput/PushPreferencesResponse/ChannelPushPreferencesResponse, scoped to chat and calls (feeds out of scope):PushPreference(input):call_level,channel_cid,chat_level,chat_preferences,disabled_until,remove_disable,user_id.ChatPreferences(granular per-mention prefs) andPushPreferencesResponse.ChatLevelPushPreferencetoall | mentions | direct_mentions | all_mentions | none | default.ChannelPushPreference,UpsertPushPreferencesResponse, andpush_preferencesonChannelAPIResponse/OwnUserBase.client.setPushPreferences(prefs: PushPreference[])is unchanged — it already wraps the array as{ preferences }.callLevel,chatLevel,disabledUntil,removeDisableon the input types anduserPreferences/userChannelPreferenceson the response. They were silently ignored by the server (input) or never populated (response), so nothing breaks at runtime, but code referencing the old names will need to switch to snake_case.Verified with
yarn typesandyarn lint(zero warnings); full unit suite green.Changelog
PushPreferencetypes to match the API: addchannel_cidanduser_id, switch to snake_case (chat_level,chat_preferences,disabled_until,remove_disable), addChatPreferences/PushPreferencesResponse, and remove the non-functional camelCase keys.