-
Notifications
You must be signed in to change notification settings - Fork 2
[ECO-5330] Implement remaining LiveMap access API
#22
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
3c3ff03 to
fa255c1
Compare
Motivation as in 3f6de86; the new spec points in [1] tell us these can throw. [1] ably/specification#341
1a74632 to
9093395
Compare
I didn't do this in cb427d8 because the specification hadn't yet specified the status code (it was an outstanding question on the PR at time of implementing), but the newly-written spec [1] for other LiveMap getter methods _does_ specify the status code as being 400. So DRY up the creation of these errors, and supply a status code (assuming that the spec will be updated to specify 400 for these existing ones too). [1] ably/specification#341
Based on [1] at 7d4c215. A few outstanding questions on the PR; have implemented based on my current understanding of what's there. Development approach similar to that described in cb427d8. Also, have not implemented the specification points related to RTO2's channel mode checking for same reasons as mentioned there. [1] ably/specification#341
9093395 to
8d881e2
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
WalkthroughThe changes introduce a new internal error type, Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant LiveMap
participant Channel
Client->>LiveMap: Access property (e.g., size, entries, keys, values)
LiveMap->>Channel: Check channel state
alt Channel state is attached
LiveMap-->>Client: Return requested data
else Channel state is detached or failed
LiveMap->>LiveObjectsError: Create error with operation and state
LiveObjectsError->>LiveMap: Convert to ARTErrorInfo
LiveMap-->>Client: Throw ARTErrorInfo
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (9)
🧰 Additional context used🧬 Code Graph Analysis (5)Tests/AblyLiveObjectsTests/JS Integration Tests/ObjectsIntegrationTests.swift (1)
Sources/AblyLiveObjects/DefaultRealtimeObjects.swift (1)
Sources/AblyLiveObjects/Internal/DefaultLiveCounter.swift (1)
Tests/AblyLiveObjectsTests/DefaultLiveMapTests.swift (5)
Sources/AblyLiveObjects/Internal/DefaultLiveMap.swift (4)
🔇 Additional comments (20)
✨ 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 (
|
umair-ably
left a comment
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.
LGTM
Note: This PR is based on top of #21; please review that one first.
Simple PR that implements the APIs specified in ably/specification#341. See commit messages for more details.
Summary by CodeRabbit
New Features
size,entries,keys, andvaluesproperties on Live Maps, providing more robust error handling when channel state is invalid.Bug Fixes
Tests