-
Notifications
You must be signed in to change notification settings - Fork 369
feat(llc): add skipPush to updateMessage #2332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit introduces a new optional parameter `skipPush` to the `updateMessage` method in `Channel`, `StreamChatClient`, and `MessageApi`. When `skipPush` is set to `true`, push notifications will not be sent for the updated message. This is useful for scenarios where you want to update a message without notifying users.
WalkthroughSupport for a new Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Channel
participant StreamChatClient
participant MessageApi
participant Server
Caller->>Channel: updateMessage(message, skipPush)
Channel->>StreamChatClient: updateMessage(message, skipPush)
StreamChatClient->>MessageApi: updateMessage(message, skipPush)
MessageApi->>Server: POST /updateMessage {skip_push: skipPush}
Server-->>MessageApi: UpdateMessageResponse
MessageApi-->>StreamChatClient: UpdateMessageResponse
StreamChatClient-->>Channel: UpdateMessageResponse
Channel-->>Caller: UpdateMessageResponse
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/stream_chat/lib/src/client/client.dart (1)
1675-1675
: Consider adding documentation for the new parameter.The
skipPush
parameter addition is correct and maintains backward compatibility with its default value offalse
. However, consider adding documentation to describe when and why this parameter should be used./// Update the given message + /// If [skipPush] is true, no push notification will be sent for this update. Future<UpdateMessageResponse> updateMessage( Message message, { bool skipPush = false, bool skipEnrichUrl = false, }) =>
packages/stream_chat/lib/src/client/channel.dart (1)
761-761
: Consider adding parameter documentation.The new
skipPush
parameter should be documented in the method's documentation comment to maintain consistency with the existing codebase and help developers understand its purpose./// Updates the [message] in this channel. + /// + /// If [skipPush] is true the message will not send a push notification. /// /// Waits for a [_messageAttachmentsUploadCompleter] to complete /// before actually updating the message.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/stream_chat/CHANGELOG.md
(1 hunks)packages/stream_chat/lib/src/client/channel.dart
(2 hunks)packages/stream_chat/lib/src/client/client.dart
(1 hunks)packages/stream_chat/lib/src/core/api/message_api.dart
(1 hunks)packages/stream_chat/test/src/core/api/message_api_test.dart
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: analyze_legacy_versions
- GitHub Check: stream_chat_persistence
- GitHub Check: analyze
- GitHub Check: test
- GitHub Check: build (android)
- GitHub Check: stream_chat_flutter_core
- GitHub Check: stream_chat_localizations
- GitHub Check: stream_chat
- GitHub Check: stream_chat_flutter
🔇 Additional comments (6)
packages/stream_chat/CHANGELOG.md (1)
6-7
: LGTM! Clear and accurate documentation.The changelog entry properly documents the new
skipPush
feature, clearly explaining its purpose and functionality.packages/stream_chat/test/src/core/api/message_api_test.dart (1)
146-146
: LGTM! Test correctly updated to match the new API signature.The test now properly expects the
skip_push
parameter in the HTTP request data, ensuring the new parameter is covered in the test suite.packages/stream_chat/lib/src/core/api/message_api.dart (2)
139-139
: LGTM! Parameter properly added with appropriate default value.The
skipPush
parameter follows the established pattern and provides a sensible default offalse
.
146-146
: LGTM! Request payload correctly includes the new parameter.The
skip_push
field is properly included in the HTTP request data, maintaining consistency with the naming convention (snake_case for API payload).packages/stream_chat/lib/src/client/client.dart (1)
1680-1680
: LGTM: Parameter forwarding is correct.The
skipPush
parameter is properly forwarded to the underlying API call, maintaining consistency with the method signature changes.packages/stream_chat/lib/src/client/channel.dart (1)
807-807
: LGTM: Parameter forwarding is correct.The
skipPush
parameter is properly forwarded to the underlying client method with appropriate named parameter syntax, maintaining consistency with the existing codebase.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2332 +/- ##
=======================================
Coverage 63.65% 63.65%
=======================================
Files 409 409
Lines 25617 25617
=======================================
Hits 16306 16306
Misses 9311 9311 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description of the pull request
This commit introduces a new optional parameter
skipPush
to theupdateMessage
method inChannel
,StreamChatClient
, andMessageApi
.When
skipPush
is set totrue
, push notifications will not be sent for the updated message. This is useful for scenarios where you want to update a message without notifying users.Summary by CodeRabbit
New Features
Documentation
Tests