Skip to content

Conversation

@VeskeR
Copy link
Contributor

@VeskeR VeskeR commented Apr 17, 2025

Merge changes from the next PRs into integration/liveobjects:

into the integration/liveobjects branch. No changes made during merge conflict resolution.

Summary by CodeRabbit

  • New Features

    • Introduced two new channel modes: annotation publishing and annotation subscribing.
    • Added support for message annotations, now accessible via channel annotations.
    • Annotation objects now support optional name and count properties.
  • Bug Fixes

    • Resolved an issue with device authentication for the push deactivate method, allowing broader client use.
  • Other Changes

    • Updated package version to 2.7.0.
    • Improved type definitions and documentation for channel modes and annotation subscriptions.

lawrence-forooghian and others added 12 commits April 15, 2025 17:28
Fix realtime annotation subscribe signature
Missed from the initial pr due to late-stage redesign. Doesn't actually
fix any bug since it's essentially just internal typings for fields that
no internal code touches right now, but they should still be there for
the benefit of maintainers
Add ANNOTATION_* channel modes to ResolvedChannelMode types
Annotation: add a couple of missing fields
This commit merges changes from the next PRs:
- #2004
- #2008
- #2010
- #2005

into the integration/liveobjects branch. No changes made during merge
conflict resolution.
@coderabbitai
Copy link

coderabbitai bot commented Apr 17, 2025

Walkthrough

This update introduces version 2.7.0, adding two new channel modes: ANNOTATION_PUBLISH and ANNOTATION_SUBSCRIBE. These modes enable publishing and receiving message annotations, which are now accessible via channel.annotations. The subscribe method in the RealtimeAnnotations interface is updated to use the Annotation type for its listener. The Annotation and WireAnnotation classes are extended with optional name and count properties. Additionally, the package version is incremented in both package.json and the React hooks export, and minor documentation clarifications are made.

Changes

File(s) Change Summary
CHANGELOG.md, package.json, src/platform/react-hooks/src/AblyReactHooks.ts Added changelog for v2.7.0, updated package version to 2.7.0 in both package.json and React hooks export.
ably.d.ts Added ANNOTATION_PUBLISH and ANNOTATION_SUBSCRIBE to channel modes; updated subscribe signature to use Annotation.
src/common/lib/types/annotation.ts Added optional name and count properties to Annotation and WireAnnotation classes.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Channel
    participant Annotations

    Client->>Channel: Set channel mode to ANNOTATION_PUBLISH/ANNOTATION_SUBSCRIBE
    Client->>Channel: Publish message with annotations
    Channel->>Annotations: Store annotation (with optional name, count)
    Client->>Annotations: Subscribe to annotations
    Annotations-->>Client: Receive annotation (Annotation object)
Loading

Possibly related PRs

Suggested reviewers

  • lawrence-forooghian
  • SimonWoolf

Poem

Version hops and annotation dreams,
New modes join the channel streams!
With names and counts, annotations grow,
As bunnies code, their features show.
Subscribe, publish—rabbits cheer,
For 2.7.0 is finally here!
🐇✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • 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.
  • @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

@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: 1

🧹 Nitpick comments (1)
src/common/lib/types/annotation.ts (1)

62-63: Document new optional properties.
You've added name?: string and count?: number to Annotation and WireAnnotation. To improve clarity, consider adding JSDoc comments for these fields describing their semantics and usage.

Also applies to: 92-93

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a9719c6 and 895ead7.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • CHANGELOG.md (1 hunks)
  • ably.d.ts (4 hunks)
  • package.json (1 hunks)
  • src/common/lib/types/annotation.ts (2 hunks)
  • src/platform/react-hooks/src/AblyReactHooks.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: test-node (20.x)
  • GitHub Check: test-browser (webkit)
  • GitHub Check: test-browser (firefox)
  • GitHub Check: test-node (18.x)
  • GitHub Check: test-node (16.x)
  • GitHub Check: test-browser (chromium)
  • GitHub Check: test-npm-package
🔇 Additional comments (10)
package.json (1)

4-4: Verify version bump consistency.
The package version has been updated to "2.7.0". Please confirm this aligns with your release tagging, CHANGELOG entry, and any automated release workflows (e.g., CI/CD scripts).

src/platform/react-hooks/src/AblyReactHooks.ts (1)

15-15: Confirm version constant matches package.json.
The version constant is updated to '2.7.0', matching the bump in package.json. Ensure these stay in sync for future releases.

CHANGELOG.md (3)

5-5: Validate new changelog entry header.
The header ## [2.7.0] (2025-04-17) correctly reflects the release version and date.


7-8: Review feature bullets for accuracy.
The bullets introducing ANNOTATION_PUBLISH & ANNOTATION_SUBSCRIBE modes and support for channel.annotations reference PR #1953 correctly.


10-11: Approve bug fix and type update bullets.
The fix for the deactivate device auth issue (#2000) and the optional callback type update are accurately documented.

ably.d.ts (5)

920-921: Documentation improvement for SUBSCRIBE mode.

The description for the SUBSCRIBE mode has been refined to clarify that the client will receive messages. This improves clarity in the API documentation.


929-930: Documentation improvement for PRESENCE_SUBSCRIBE mode.

The description for the PRESENCE_SUBSCRIBE mode has been refined to clarify that the client will receive presence messages. This improves clarity in the API documentation.


939-946: Addition of new annotation channel modes.

Two new channel modes have been added to support the annotations feature:

  1. ANNOTATION_PUBLISH: Allows clients to publish annotations
  2. ANNOTATION_SUBSCRIBE: Allows clients to receive annotations

This addition properly extends the type system to support the new annotation functionality.


962-964: Updated ResolvedChannelMode union type with new annotation modes.

The ResolvedChannelMode union type has been extended to include the new annotation-related channel modes, ensuring they are recognized as valid options throughout the SDK.


2119-2119: Updated RealtimeAnnotations.subscribe method signature.

The subscribe method signature has been updated to use the Annotation type for its listener callback instead of PresenceMessage. This aligns the type system with the new annotation feature and ensures type safety when working with annotations.


- Adds `ANNOTATION_PUBLISH` and `ANNOTATION_SUBSCRIBE` channel modes [\#1953](https://github.com/ably/ably-js/pull/1953)
- Adds support for message annotations via `channel.annotations` [\#1953](https://github.com/ably/ably-js/pull/1953)
- The message action `meta.occupancy` is now renamed to `meta`. Similarly, `MessageActions.META` is now `MessageActions.META` [\#1953](https://github.com/ably/ably-js/pull/1953)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix redundant bullet text.
The second half of this bullet reads "MessageActions.META is now MessageActions.META", which is tautological. It likely should state that MessageActions.META_OCCUPANCY has been renamed to MessageActions.META. Please correct this.

@VeskeR VeskeR merged commit caa8ba1 into integration/liveobjects Apr 17, 2025
13 of 14 checks passed
@VeskeR VeskeR deleted the liveobjects/merge-main-2025-04-17 branch April 17, 2025 16:18
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.

6 participants