[AIT-324] Add supporting API needed for apply-on-ACK#11
[AIT-324] Add supporting API needed for apply-on-ACK#11lawrence-forooghian merged 1 commit intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds optional protocol methods and new publish-result protocols, exposes connection site code, and updates README with dependency/setup and a change playbook. No behavioral changes to existing APIs; additions are opt-in/optional. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
README.md (1)
24-25: Tighten wording for clarity and consistency.Small doc polish: replace “is able to” with “can” (Line 24, Line 65), and consider “outdated version” instead of “old version” (Line 53) for stronger wording.
Also applies to: 53-53, 65-65
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 24 - 25, Update the README wording for clarity: replace the phrase "is able to" with "can" in both occurrences (the sentence "a given version of the plugin is able to specify a _minimum_ version of ably-cocoa" and the similar sentence at the other occurrence), and replace "old version" with "outdated version" where it appears (the sentence discussing version compatibility) to strengthen phrasing and maintain consistency.Sources/_AblyPluginSupportPrivate/include/APPublishResult.h (1)
5-21: Consider addingNS_SWIFT_SENDABLEfor consistency.Other protocols in this PR (e.g.,
APConnectionDetailsProtocol,APPluginAPIProtocol,APLiveObjectsPluginProtocol) include theNS_SWIFT_SENDABLEannotation. For consistency and to ensure these protocols can be safely used across concurrency boundaries in Swift, consider adding the annotation here as well.Note: The static analysis errors are false positives—the file uses valid Objective-C module imports and Foundation macros that require framework context to parse correctly.
Proposed change
/// The serial for a single published message. NS_SWIFT_NAME(PublishResultSerialProtocol) +NS_SWIFT_SENDABLE `@protocol` APPublishResultSerialProtocol <NSObject> /// The message serial of the published message, or `nil` if the message was discarded due to a configured conflation rule. `@property` (nullable, nonatomic, readonly) NSString *value; `@end` /// Contains the result of a publish operation. NS_SWIFT_NAME(PublishResultProtocol) +NS_SWIFT_SENDABLE `@protocol` APPublishResultProtocol <NSObject>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Sources/_AblyPluginSupportPrivate/include/APPublishResult.h` around lines 5 - 21, Add the NS_SWIFT_SENDABLE annotation to the two publish-result protocols to match other protocols in the PR: annotate APPublishResultSerialProtocol and APPublishResultProtocol with NS_SWIFT_SENDABLE (e.g., NS_SWIFT_NAME(PublishResultSerialProtocol) NS_SWIFT_SENDABLE on APPublishResultSerialProtocol and NS_SWIFT_NAME(PublishResultProtocol) NS_SWIFT_SENDABLE on APPublishResultProtocol) so they are marked sendable for Swift concurrency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@README.md`:
- Around line 24-25: Update the README wording for clarity: replace the phrase
"is able to" with "can" in both occurrences (the sentence "a given version of
the plugin is able to specify a _minimum_ version of ably-cocoa" and the similar
sentence at the other occurrence), and replace "old version" with "outdated
version" where it appears (the sentence discussing version compatibility) to
strengthen phrasing and maintain consistency.
In `@Sources/_AblyPluginSupportPrivate/include/APPublishResult.h`:
- Around line 5-21: Add the NS_SWIFT_SENDABLE annotation to the two
publish-result protocols to match other protocols in the PR: annotate
APPublishResultSerialProtocol and APPublishResultProtocol with NS_SWIFT_SENDABLE
(e.g., NS_SWIFT_NAME(PublishResultSerialProtocol) NS_SWIFT_SENDABLE on
APPublishResultSerialProtocol and NS_SWIFT_NAME(PublishResultProtocol)
NS_SWIFT_SENDABLE on APPublishResultProtocol) so they are marked sendable for
Swift concurrency.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
README.mdSources/_AblyPluginSupportPrivate/include/APConnectionDetails.hSources/_AblyPluginSupportPrivate/include/APLiveObjectsPlugin.hSources/_AblyPluginSupportPrivate/include/APPluginAPI.hSources/_AblyPluginSupportPrivate/include/APPublishResult.h
693fb5e to
242fac1
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Sources/_AblyPluginSupportPrivate/include/APPluginAPI.h (1)
86-89: Clarify callback invariants forcompletionWithResult.Please document whether
publishResultis guaranteed non-null on success and expected to be null on error. That removes ambiguity for plugin-side branching.✍️ Suggested doc tweak
-/// Same as `-nosync_sendObjectWithObjectMessages:channel:completion:`, but the completion handler additionally receives an `APPublishResultProtocol` containing the serials assigned to the published messages by the server. +/// Same as `-nosync_sendObjectWithObjectMessages:channel:completion:`, but the completion handler additionally receives an `APPublishResultProtocol` containing the serials assigned to the published messages by the server. +/// +/// Contract: on success, `error == nil` and `publishResult != nil`; on failure, `error != nil` and `publishResult == nil`. - (void)nosync_sendObjectWithObjectMessages:(NSArray<id<APObjectMessageProtocol>> *)objectMessages channel:(id<APRealtimeChannel>)channel completionWithResult:(void (^ _Nullable)(_Nullable id<APPublicErrorInfo> error, _Nullable id<APPublishResultProtocol> publishResult))completion;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Sources/_AblyPluginSupportPrivate/include/APPluginAPI.h` around lines 86 - 89, Update the documentation comment for the method nosync_sendObjectWithObjectMessages:channel:completionWithResult: to state the callback invariants explicitly: on success the completion's error parameter is nil and the publishResult (id<APPublishResultProtocol>) is non-nil and contains assigned serials; on failure the error (id<APPublicErrorInfo>) is non-nil and publishResult is nil; ensure the comment uses those exact symbols (APPublishResultProtocol, APPublicErrorInfo, completionWithResult) so plugin authors know how to branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@Sources/_AblyPluginSupportPrivate/include/APPluginAPI.h`:
- Around line 86-89: Update the documentation comment for the method
nosync_sendObjectWithObjectMessages:channel:completionWithResult: to state the
callback invariants explicitly: on success the completion's error parameter is
nil and the publishResult (id<APPublishResultProtocol>) is non-nil and contains
assigned serials; on failure the error (id<APPublicErrorInfo>) is non-nil and
publishResult is nil; ensure the comment uses those exact symbols
(APPublishResultProtocol, APPublicErrorInfo, completionWithResult) so plugin
authors know how to branch.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
README.mdSources/_AblyPluginSupportPrivate/include/APConnectionDetails.hSources/_AblyPluginSupportPrivate/include/APLiveObjectsPlugin.hSources/_AblyPluginSupportPrivate/include/APPluginAPI.hSources/_AblyPluginSupportPrivate/include/APPublishResult.h
🚧 Files skipped from review as they are similar to previous changes (1)
- Sources/_AblyPluginSupportPrivate/include/APLiveObjectsPlugin.h
Add methods for plugin to: - get PublishResult when performing a publish - learn about channel state changes - learn about the siteCode of the server it's connected to Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
242fac1 to
8bfbbaa
Compare
Add methods for plugin to:
PublishResultwhen performing a publishsiteCodeof the server it's connected toRelated PRs:
Summary by CodeRabbit
Documentation
New Features