Skip to content

Conversation

xsahil03x
Copy link
Member

@xsahil03x xsahil03x commented Jul 25, 2025

Description of the pull request

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.

Summary by CodeRabbit

  • New Features

    • Added support for skipping push notifications when updating a message. You can now update messages without triggering a push notification by using the new option.
  • Documentation

    • Updated the changelog to reflect the new skip push notification feature.
  • Tests

    • Enhanced tests to verify the correct handling of the skip push notification option during message updates.

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.
@xsahil03x xsahil03x requested a review from renefloor July 25, 2025 11:00
Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

Walkthrough

Support for a new skipPush boolean parameter was added to the message update functionality in the stream_chat package. This parameter, defaulting to false, allows callers to suppress push notifications when updating messages. The change is reflected in the core API, client, channel, and corresponding test cases, with documentation updated accordingly.

Changes

File(s) Change Summary
packages/stream_chat/CHANGELOG.md Updated changelog to document support for skipPush in message updates.
packages/stream_chat/lib/src/client/channel.dart Added optional skipPush parameter to Channel.updateMessage and passed it through to the client.
packages/stream_chat/lib/src/client/client.dart Added optional skipPush parameter to StreamChatClient.updateMessage and passed it to the API.
packages/stream_chat/lib/src/core/api/message_api.dart Added optional skipPush parameter to MessageApi.updateMessage; included it in the POST payload.
packages/stream_chat/test/src/core/api/message_api_test.dart Updated tests to expect 'skip_push': false in the message update and send payloads.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A hop and a skip, a push we now miss,
With skipPush in place, no buzz or a hiss!
Messages update, but silence remains,
The code flows like carrots after gentle spring rains.
🥕✨ Hooray for the quiet, let’s hop to the next gains!

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-skip-push-to-update-message

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 of false. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 58d25c3 and 520d810.

📒 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 of false.


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.

@xsahil03x xsahil03x changed the title feat(core): add skipPush to updateMessage feat(llc): add skipPush to updateMessage Jul 25, 2025
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.65%. Comparing base (58d25c3) to head (520d810).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xsahil03x xsahil03x merged commit d95dbce into master Jul 25, 2025
19 of 21 checks passed
@xsahil03x xsahil03x deleted the feat/add-skip-push-to-update-message branch July 25, 2025 11:10
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.

2 participants