Skip to content
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

[ECO-5187] Update message actions in line with updated TM5 spec point #2007

Closed
wants to merge 1 commit into from

Conversation

umair-ably
Copy link
Contributor

@umair-ably umair-ably commented Jan 9, 2025

Updates message actions based on changes to spec @ ably/specification#263

JS equivalent: ably/ably-js@52d143a

Summary by CodeRabbit

  • New Features

    • Added a new message action ARTMessageActionSummary for rolled-up annotation summaries.
  • Refactor

    • Removed deprecated message action enum values related to annotations.

Copy link

coderabbitai bot commented Jan 9, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 SwiftLint (0.57.0)
Test/Tests/UtilitiesTests.swift

[
{
"character" : 72,
"file" : "/Test/Tests/UtilitiesTests.swift",
"line" : 101,
"reason" : "Force casts should be avoided",
"rule_id" : "force_cast",
"severity" : "Error",
"type" : "Force Cast"
}
]

Walkthrough

The pull request introduces modifications to the ARTMessageAction enumeration in the ARTMessage.h file. Specifically, it removes three enum values related to annotations (ARTMessageActionUnset, ARTMessageActionAnnotationCreate, and ARTMessageActionAnnotationDelete) and adds a new enum value ARTMessageActionSummary. The changes are accompanied by updates in the UtilitiesTests.swift file, which adjusts the test cases to reflect the new message action handling logic.

Changes

File Change Summary
Source/include/Ably/ARTMessage.h - Removed ARTMessageActionUnset enum value
- Removed ARTMessageActionAnnotationCreate enum value
- Removed ARTMessageActionAnnotationDelete enum value
- Added ARTMessageActionSummary enum value
Test/Tests/UtilitiesTests.swift - Modified message action handling tests
- Updated test cases for action, serial, and createdAt fields

Assessment against linked issues

Objective Addressed Explanation
Update ably-cocoa to reflect message action spec changes [ECO-5187]

Poem

🐰 In the realm of messages, a change takes flight,
Enum values dance, some vanish from sight.
A summary action springs forth with grace,
Annotations fade, leaving not a trace.
Code evolves, a rabbit's delight! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aca9a7c and 910af84.

📒 Files selected for processing (2)
  • Source/include/Ably/ARTMessage.h (1 hunks)
  • Test/Tests/UtilitiesTests.swift (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: check (macOS, test_macOS)
  • GitHub Check: check (tvOS, test_tvOS17_2)
  • GitHub Check: check (iOS, test_iOS17_2)
  • GitHub Check: build
  • GitHub Check: check
  • GitHub Check: check
🔇 Additional comments (3)
Source/include/Ably/ARTMessage.h (1)

28-32: LGTM! The new message action aligns with the TM5 spec.

The addition of ARTMessageActionSummary for rolled-up annotation summaries is well-documented and follows the updated specification.

Test/Tests/UtilitiesTests.swift (2)

495-497: LGTM! Test correctly verifies serial assignment behavior.

The test properly validates that:

  1. Create actions (0) inherit serial from version
  2. Update actions (1) maintain separate serial and version fields

Also applies to: 513-515, 522-524


561-563: LGTM! Test correctly verifies createdAt timestamp behavior.

The test properly validates that:

  1. Create actions (0) set createdAt from timestamp
  2. Update actions (1) maintain createdAt as nil

Also applies to: 579-581, 588-590

Finishing Touches

  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

@umair-ably umair-ably changed the title Update message actions in line with updated TM5 spec point [ECO-5187] Update message actions in line with updated TM5 spec point Jan 9, 2025
@maratal
Copy link
Collaborator

maratal commented Jan 9, 2025

This is what @SimonWoolf alreeady merged into main, unless I'm missing something.

@umair-ably
Copy link
Contributor Author

Simon beat me to it - seems like we both did the change on the same day

@umair-ably umair-ably closed this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants