Skip to content

[AIT-322] Bump protocol version to v6 and add plugin compatibility checks#2191

Open
lawrence-forooghian wants to merge 1 commit intointegration/protocol-v6from
AIT-322-v6-ProtocolMessage
Open

[AIT-322] Bump protocol version to v6 and add plugin compatibility checks#2191
lawrence-forooghian wants to merge 1 commit intointegration/protocol-v6from
AIT-322-v6-ProtocolMessage

Conversation

@lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Feb 24, 2026

Note: This targets the integration/protocol-v6 branch.

Summary

This implements the protocol-version-bumping process proposed in ably/ably-cocoa-plugin-support#10.

Note that all of the v6 changes are LiveObjects-related, hence no other changes in ably-cocoa.

Related PRs

Summary by CodeRabbit

  • New Features

    • Upgraded API version to v6
    • Added LiveObjects Protocol v6 compatibility flag and runtime validation
  • Improvements

    • Implemented version-aware default idempotent REST publishing (changes behavior for versions >1.2)
  • Tests

    • Updated tests and expectations to reflect API version v6

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

Walkthrough

This PR bumps the library API to version 6, pins the ably-cocoa-plugin-support dependency to a specific revision (with a TODO to unpin), adds Live Objects Protocol v6 compatibility checks and a version-based default idempotent REST publishing helper, and updates tests to expect API version 6.

Changes

Cohort / File(s) Summary
Package Dependencies
Package.resolved, Package.swift
Pinned ably-cocoa-plugin-support from semantic version 1.0.0 to .revision("e015e70"); added // TODO: Unpin before release. Package.resolved updated to match revision.
API Version Constant & Tests
Source/ARTDefault.m, Test/AblyTests/Tests/ARTDefaultTests.swift, Test/AblyTests/Tests/RealtimeClientConnectionTests.swift, Test/AblyTests/Tests/RealtimeClientTests.swift, Test/AblyTests/Tests/RestClientTests.swift
Changed API version value from "5" to "6" and updated test expectations/assertions that referenced the previous version.
Live Objects Protocol v6 Changes
Source/ARTClientOptions.m, Source/ARTPluginAPI.m, Test/AblyTests/Tests/PluginAPITests.swift
Added + (BOOL)getDefaultIdempotentRestPublishingForVersion:(NSString *)version to ARTClientOptions; added runtime assertion that internal live-objects plugin is compatibleWithProtocolV6; added - (BOOL)usesLiveObjectsProtocolV6 to ARTPluginAPI; added compatibleWithProtocolV6 property to test mock.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A little hop to version six,
Pins and checks and tiny tricks,
Plugins nod, the tests agree,
Revision locked — till we set it free,
Rabbit cheers: "Release, but not just yet!" 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: bumping protocol version from v5 to v6 and adding plugin compatibility checks for v6 support.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch AIT-322-v6-ProtocolMessage

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 24, 2026 14:13 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 24, 2026 14:16 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 24, 2026 14:20 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/jazzydoc February 24, 2026 14:23 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/markdown-api-reference February 24, 2026 14:23 Inactive
@lawrence-forooghian lawrence-forooghian changed the base branch from main to protocol-v6 February 25, 2026 11:49
@lawrence-forooghian lawrence-forooghian changed the base branch from protocol-v6 to integration/protocol-v6 February 25, 2026 11:50
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 25, 2026 13:31 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/jazzydoc February 25, 2026 13:39 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/markdown-api-reference February 25, 2026 13:39 Inactive
@lawrence-forooghian lawrence-forooghian changed the title Bump protocol version to v6 and add plugin compatibility checks [WIP] Bump protocol version to v6 and add plugin compatibility checks Feb 25, 2026
@lawrence-forooghian lawrence-forooghian changed the title [WIP] Bump protocol version to v6 and add plugin compatibility checks [WIP, AIT-322] Bump protocol version to v6 and add plugin compatibility checks Feb 25, 2026
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 25, 2026 14:00 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/jazzydoc February 25, 2026 14:05 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/markdown-api-reference February 25, 2026 14:05 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 25, 2026 14:13 Inactive
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review February 25, 2026 14:14
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 25, 2026 14:16 Inactive
@lawrence-forooghian lawrence-forooghian changed the title [WIP, AIT-322] Bump protocol version to v6 and add plugin compatibility checks [AIT-322] Bump protocol version to v6 and add plugin compatibility checks Feb 25, 2026
@github-actions github-actions bot temporarily deployed to staging/pull/2191/jazzydoc February 25, 2026 14:20 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/markdown-api-reference February 25, 2026 14:20 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 25, 2026 14:21 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 25, 2026 14:25 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/jazzydoc February 25, 2026 14:31 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/markdown-api-reference February 25, 2026 14:31 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/features February 25, 2026 14:36 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/jazzydoc February 25, 2026 14:41 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2191/markdown-api-reference February 25, 2026 14:41 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: 1

🧹 Nitpick comments (1)
Package.swift (1)

22-23: Use the full commit SHA for the revision pin.

Line 23 uses a short SHA (e015e70). Prefer the full 40-char hash to avoid ambiguity in future Git resolution.

♻️ Proposed change
-        .package(name: "ably-cocoa-plugin-support", url: "https://github.com/ably/ably-cocoa-plugin-support", .revision("e015e70"))
+        .package(name: "ably-cocoa-plugin-support", url: "https://github.com/ably/ably-cocoa-plugin-support", .revision("e015e708b4c8f4eaf97958cb94e34167cd1ef6b3"))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Package.swift` around lines 22 - 23, The package declaration pins the
dependency "ably-cocoa-plugin-support" using a short commit SHA
(.revision("e015e70")), which can be ambiguous; replace the short SHA with the
full 40-character commit hash for the .revision value in the .package(...) entry
so the dependency resolves deterministically (locate the .package(name:
"ably-cocoa-plugin-support", url:
"https://github.com/ably/ably-cocoa-plugin-support", .revision("e015e70")) line
and update the .revision string to the full commit SHA).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Source/ARTClientOptions.m`:
- Around line 254-257: Replace the debug-only NSAssert with a runtime guard that
enforces plugin compatibility in all builds: after obtaining
id<APLiveObjectsInternalPluginProtocol> plugin = [publicPlugin internalPlugin],
check if (!plugin.compatibleWithProtocolV6) and then fail deterministically
(e.g., log the error with NSLog/processLogger and raise an NSException or call
abort()) so an incompatible plugin cannot silently pass in Release; keep the
same message string and reference plugin.compatibleWithProtocolV6 and
[publicPlugin internalPlugin] when implementing the check.

---

Nitpick comments:
In `@Package.swift`:
- Around line 22-23: The package declaration pins the dependency
"ably-cocoa-plugin-support" using a short commit SHA (.revision("e015e70")),
which can be ambiguous; replace the short SHA with the full 40-character commit
hash for the .revision value in the .package(...) entry so the dependency
resolves deterministically (locate the .package(name:
"ably-cocoa-plugin-support", url:
"https://github.com/ably/ably-cocoa-plugin-support", .revision("e015e70")) line
and update the .revision string to the full commit SHA).

ℹ️ 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 14d2661 and 3bf6c74.

📒 Files selected for processing (10)
  • Package.resolved
  • Package.swift
  • Source/ARTClientOptions.m
  • Source/ARTDefault.m
  • Source/ARTPluginAPI.m
  • Test/AblyTests/Tests/ARTDefaultTests.swift
  • Test/AblyTests/Tests/PluginAPITests.swift
  • Test/AblyTests/Tests/RealtimeClientConnectionTests.swift
  • Test/AblyTests/Tests/RealtimeClientTests.swift
  • Test/AblyTests/Tests/RestClientTests.swift

This implements the protocol-version-bumping process proposed in the
pinned plugin-support commit.

Note that all of the v6 changes are LiveObjects-related, hence no other
changes in ably-cocoa.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

🧹 Nitpick comments (2)
Test/AblyTests/Tests/PluginAPITests.swift (1)

17-19: Add one negative-path test for protocol compatibility.

This mock now hardcodes compatibility to true; please add a companion test with compatibleWithProtocolV6 == false to assert the expected failure path for the new compatibility check.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Test/AblyTests/Tests/PluginAPITests.swift` around lines 17 - 19, Add a
negative-path unit test alongside the existing positive case that uses a
MockInternalLiveObjectsPlugin variant where compatibleWithProtocolV6 returns
false; create a new test (e.g.,
testLiveObjectsPluginCompatibilityRejectsIncompatiblePlugin) that registers or
injects this mock into the same code path under test and asserts the
compatibility check fails/throws or causes the expected rejection behavior
(matching the existing positive test’s assertions but inverted). Locate the mock
class MockInternalLiveObjectsPlugin and either add a second subclass/instance
with var compatibleWithProtocolV6: Bool { false } or parameterize the mock, then
update PluginAPITests.swift to include the new test invoking the same
initialization/registration logic used by the current success test and assert
the negative outcome.
Package.swift (1)

22-23: Use full commit SHA in .revision(...) for deterministic pinning.

The short SHA e015e70 at line 23 is ambiguous in the remote repository—git ls-remote returns 2 matching refs. Replace it with the full commit hash already present in Package.resolved:

Diff
-        .package(name: "ably-cocoa-plugin-support", url: "https://github.com/ably/ably-cocoa-plugin-support", .revision("e015e70"))
+        .package(name: "ably-cocoa-plugin-support", url: "https://github.com/ably/ably-cocoa-plugin-support", .revision("e015e708b4c8f4eaf97958cb94e34167cd1ef6b3"))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Package.swift` around lines 22 - 23, Replace the ambiguous short revision
used in the Swift package declaration for "ably-cocoa-plugin-support" by using
the full commit SHA from Package.resolved; locate the .package(...) entry for
name "ably-cocoa-plugin-support" and update the .revision("e015e70") value to
the complete 40-character commit hash so the dependency is deterministically
pinned.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Package.swift`:
- Around line 22-23: Replace the ambiguous short revision used in the Swift
package declaration for "ably-cocoa-plugin-support" by using the full commit SHA
from Package.resolved; locate the .package(...) entry for name
"ably-cocoa-plugin-support" and update the .revision("e015e70") value to the
complete 40-character commit hash so the dependency is deterministically pinned.

In `@Test/AblyTests/Tests/PluginAPITests.swift`:
- Around line 17-19: Add a negative-path unit test alongside the existing
positive case that uses a MockInternalLiveObjectsPlugin variant where
compatibleWithProtocolV6 returns false; create a new test (e.g.,
testLiveObjectsPluginCompatibilityRejectsIncompatiblePlugin) that registers or
injects this mock into the same code path under test and asserts the
compatibility check fails/throws or causes the expected rejection behavior
(matching the existing positive test’s assertions but inverted). Locate the mock
class MockInternalLiveObjectsPlugin and either add a second subclass/instance
with var compatibleWithProtocolV6: Bool { false } or parameterize the mock, then
update PluginAPITests.swift to include the new test invoking the same
initialization/registration logic used by the current success test and assert
the negative outcome.

ℹ️ 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 3bf6c74 and e9cd9e1.

📒 Files selected for processing (10)
  • Package.resolved
  • Package.swift
  • Source/ARTClientOptions.m
  • Source/ARTDefault.m
  • Source/ARTPluginAPI.m
  • Test/AblyTests/Tests/ARTDefaultTests.swift
  • Test/AblyTests/Tests/PluginAPITests.swift
  • Test/AblyTests/Tests/RealtimeClientConnectionTests.swift
  • Test/AblyTests/Tests/RealtimeClientTests.swift
  • Test/AblyTests/Tests/RestClientTests.swift
🚧 Files skipped from review as they are similar to previous changes (4)
  • Test/AblyTests/Tests/RestClientTests.swift
  • Source/ARTClientOptions.m
  • Test/AblyTests/Tests/RealtimeClientConnectionTests.swift
  • Source/ARTPluginAPI.m

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.

1 participant