Skip to content

Fix code snippet in README#64

Merged
lawrence-forooghian merged 1 commit intomainfrom
fix-readme-example-code
Aug 20, 2025
Merged

Fix code snippet in README#64
lawrence-forooghian merged 1 commit intomainfrom
fix-readme-example-code

Conversation

@lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Aug 14, 2025

Specify channel modes, and attach the channel (we will shortly be introducing an implicit attach on getRoot but we don't have it yet).

Summary by CodeRabbit

  • Documentation
    • Updated README and in-code sample to require explicit channel options enabling object publish/subscribe modes.
    • Showed fetching a channel with options, calling channel.attach() asynchronously, then accessing LiveObjects via channel.objects.
    • Clarified usage flow and step order for object interactions.
    • Confirmed no public API signature changes.

@coderabbitai
Copy link

coderabbitai bot commented Aug 14, 2025

Walkthrough

The README and in-repo documentation were updated to demonstrate obtaining a channel with explicit options enabling object publish/subscribe modes, calling channel.attach() (awaiting attachment) before accessing channel.objects, and then interacting with LiveObjects (e.g., retrieving the root object). No public API signatures changed.

Changes

Cohort / File(s) Summary of Changes
Docs: README sample updated
README.md
Replaced previous channel retrieval snippet with an example that creates channel options (modes [.objectPublish, .objectSubscribe]), gets the channel with those options, awaits channel.attach(), and accesses LiveObjects via channel.objects (e.g., root).
Docs: In-source example updated
Sources/AblyLiveObjects/Public/Plugin.swift
Updated inline documentation/sample to match README: demonstrate constructing channel options, fetching channel with options, awaiting channel.attach() (using an async continuation), then accessing channel.objects. No API signature changes.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev
    participant Realtime
    participant Channel
    participant LiveObjects

    Dev->>Realtime: channels.get("myChannel", options: [.objectPublish, .objectSubscribe])
    Realtime-->>Channel: Channel (unattached)
    Dev->>Channel: attach() (await)
    Channel-->>Dev: attached
    Dev->>Channel: access channel.objects
    Channel-->>LiveObjects: provide objects API
    Dev->>LiveObjects: objects.root.get("someObject")
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my whiskers, docs align,
I fetch the channel, wait for the sign.
Options set, attach in place,
Objects found in cozy space.
A hop, a nibble — clearer trace. 🥕🐇


📜 Recent review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2a344c8 and 89e63d4.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • Sources/AblyLiveObjects/Public/Plugin.swift (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Sources/AblyLiveObjects/Public/Plugin.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md
⏰ 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). (12)
  • GitHub Check: Example app, tvOS (Xcode 16.3)
  • GitHub Check: Xcode, iOS (Xcode 16.3)
  • GitHub Check: Xcode, release configuration, tvOS (Xcode 16.3)
  • GitHub Check: Xcode, macOS (Xcode 16.3)
  • GitHub Check: Xcode, release configuration, macOS (Xcode 16.3)
  • GitHub Check: Xcode, tvOS (Xcode 16.3)
  • GitHub Check: Xcode, release configuration, iOS (Xcode 16.3)
  • GitHub Check: Example app, macOS (Xcode 16.3)
  • GitHub Check: Example app, iOS (Xcode 16.3)
  • GitHub Check: SPM (Xcode 16.3)
  • GitHub Check: SPM, release configuration (Xcode 16.3)
  • GitHub Check: Generate code coverage
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-readme-example-code

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@github-actions github-actions bot temporarily deployed to staging/pull/64/AblyLiveObjects August 14, 2025 13:37 Inactive
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: 2

🧹 Nitpick comments (1)
README.md (1)

28-31: Specifying LiveObjects channel modes looks right; minor doc caveat

Using ARTRealtimeChannelOptions.modes = [.objectPublish, .objectSubscribe] and passing them on the first get is correct. Note: in Ably, options are only applied when the channel is first created; subsequent get("myChannel", options: ...) calls won’t update an existing channel’s modes. Consider adding a short note so readers don’t try to retrofit modes on an already-instantiated channel.

📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 010b3e0 and 2a344c8.

📒 Files selected for processing (1)
  • README.md (1 hunks)

@lawrence-forooghian
Copy link
Collaborator Author

I need to address the feedback re waiting for attach to complete (I am deliberately not because it's really ugly; see ably/ably-cocoa#2087) and also copy this documentation to the docstring for the plugin

Specify channel modes, and attach the channel (we will shortly be
introducing an implicit attach on getRoot but we don't have it yet).
@lawrence-forooghian
Copy link
Collaborator Author

Merging this — tests are flaky (will be investigating soon) but there are no code changes here

@lawrence-forooghian lawrence-forooghian merged commit 8fcd4a2 into main Aug 20, 2025
15 of 18 checks passed
@lawrence-forooghian lawrence-forooghian deleted the fix-readme-example-code branch August 20, 2025 20:31
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