Skip to content

Integration branch for ably_pubsub_device_flutter v2 package - #606

Open
ttypic wants to merge 8 commits into
mainfrom
integration/v2
Open

ttypic wants to merge 8 commits into
mainfrom
integration/v2

Conversation

@ttypic

@ttypic ttypic commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Integration branch contains packages split, renaming and deletion of deprecated methods

The SDK now offers a realtime interface only. `Rest`, `RestChannel`,
`RestChannels`, `RestPresence`, `RestAuth` and the `Rest*` option and
param types are gone, along with their platform methods, codec types
and Android/iOS handlers. `Push` and `PushChannel` now require a
`realtime` client, and `Message`/`PresenceMessage.fromEncoded` take
`RealtimeChannelOptions`. UPDATING.md documents the migration.

Two pieces of pre-existing drift had to be fixed to regenerate the
platform constants:

- The codegen templates used `_` as a lambda parameter, which is a
  wildcard in current Dart, so `bin/codegen.dart` no longer ran.
- The generated constants had been hand-edited with entries missing
  from the codegen context (`connectionRecoveryKey`, the
  `ConnectionStateChange` connection id/key, and three Java-only
  `ClientOptions` timeout keys); these are now in the context so
  regeneration reproduces them on all three platforms.

Tests: the rest unit and integration tests are deleted; the shared
`Channels` test moves to `RealtimeChannels`, the plugin test covers
client creation over `Realtime`, and the realtime auth tests bootstrap
their tokens from a non-auto-connecting `Realtime` client.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 183 files, which is 83 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6748328a-9173-41a6-9ee8-546d92619b23
📥 Commits

Reviewing files that changed from the base of the PR and between 1537db2 and 1202d99.

⛔ Files ignored due to path filters: 6
  • android/src/main/java/io/ably/flutter/plugin/generated/PlatformConstants.java is excluded by !**/generated/**
  • example/ios/Podfile.lock is excluded by !**/*.lock
  • example/pubspec.lock is excluded by !**/*.lock
  • lib/src/generated/platform_constants.dart is excluded by !**/generated/**
  • test_integration/ios/Podfile.lock is excluded by !**/*.lock
  • test_integration/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing: 183
  • .claude/skills/release/SKILL.md
  • .github/workflows/flutter_integration.yaml
  • .github/workflows/ios_unit_tests.yml
  • API_REF_INTRO_BLURB.md
  • PushNotifications.md
  • README.md
  • UPDATING.md
  • analysis_options.yaml
  • android/settings.gradle
  • android/src/main/java/io/ably/flutter/plugin/AblyInstanceStore.java
  • android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java
  • android/src/main/java/io/ably/flutter/plugin/AblyMethodCallHandler.java
  • android/src/main/java/io/ably/flutter/plugin/AuthMethodHandler.java
  • android/src/main/java/io/ably/flutter/plugin/types/PlatformClientOptions.java
  • bin/codegen_context.dart
  • bin/templates/platformconstants.dart.dart
  • bin/templates/platformconstants.h.dart
  • bin/templates/platformconstants.java.dart
  • bin/templates/platformconstants.m.dart
  • example/example.md
  • example/ios/Runner.xcodeproj/project.pbxproj
  • example/lib/app_provisioning.dart
  • example/lib/main.dart
  • example/lib/nested_realtime_events.dart
  • example/lib/push_notifications/push_notification_handlers.dart
  • example/lib/push_notifications/push_notification_message_examples.dart
  • example/lib/push_notifications/push_notification_service.dart
  • example/lib/ui/ably_service.dart
  • example/lib/ui/paginated_result_viewer.dart
  • example/lib/ui/push_notifications/push_notifications_activation_sliver.dart
  • example/lib/ui/push_notifications/push_notifications_device_information.dart
  • example/lib/ui/push_notifications/push_notifications_ios_permissions_sliver.dart
  • example/lib/ui/push_notifications/push_notifications_received_sliver.dart
  • example/lib/ui/push_notifications/push_notifications_subscriptions_sliver.dart
  • example/lib/ui/realtime_presence_sliver.dart
  • example/lib/ui/realtime_sliver.dart
  • example/lib/ui/rest_sliver.dart
  • example/lib/ui/system_details_sliver.dart
  • example/lib/ui/utilities.dart
  • example/pubspec.yaml
  • ios/Classes/AblyFlutter.m
  • ios/Classes/AblyInstanceStore.h
  • ios/Classes/AblyInstanceStore.m
  • ios/Classes/codec/AblyFlutterReader.m
  • ios/Classes/codec/AblyFlutterWriter.m
  • ios/Classes/codec/AblyPlatformConstants.h
  • ios/Classes/codec/AblyPlatformConstants.m
  • ios/Classes/codec/CryptoCodec.swift
  • ios/Classes/handlers/AuthHandlers.swift
  • ios/Classes/handlers/PushHandlers.swift
  • ios/ably_pubsub_device_flutter.podspec
  • lib/ably_pubsub_device_flutter.dart
  • lib/src/authentication/src/auth.dart
  • lib/src/authentication/src/auth_options.dart
  • lib/src/authentication/src/client_options.dart
  • lib/src/authentication/src/token_params.dart
  • lib/src/authentication/src/token_request.dart
  • lib/src/common/src/channels.dart
  • lib/src/common/src/http_paginated_response.dart
  • lib/src/crypto/src/cipher_params.dart
  • lib/src/crypto/src/crypto.dart
  • lib/src/error/src/ably_exception.dart
  • lib/src/logging/logging.dart
  • lib/src/logging/src/log_handler.dart
  • lib/src/logging/src/log_level.dart
  • lib/src/message/src/delta_extras.dart
  • lib/src/message/src/message.dart
  • lib/src/message/src/message_extras.dart
  • lib/src/message/src/presence_message.dart
  • lib/src/platform/platform.dart
  • lib/src/platform/platform_internal.dart
  • lib/src/platform/src/ably_message.dart
  • lib/src/platform/src/background_android_isolate_platform.dart
  • lib/src/platform/src/cipher_params_internal.dart
  • lib/src/platform/src/codec.dart
  • lib/src/platform/src/info.dart
  • lib/src/platform/src/method_call_handler.dart
  • lib/src/platform/src/paginated_result.dart
  • lib/src/platform/src/platform.dart
  • lib/src/platform/src/platform_object.dart
  • lib/src/platform/src/push_activation_events_internal.dart
  • lib/src/platform/src/push_notification_events_internal.dart
  • lib/src/platform/src/realtime/connection.dart
  • lib/src/platform/src/realtime/presence.dart
  • lib/src/platform/src/realtime/pub_sub_client.dart
  • lib/src/platform/src/realtime/realtime_channel.dart
  • lib/src/platform/src/realtime/realtime_channels.dart
  • lib/src/platform/src/rest/rest.dart
  • lib/src/platform/src/rest/rest_channel.dart
  • lib/src/platform/src/rest/rest_channels.dart
  • lib/src/platform/src/rest/rest_presence.dart
  • lib/src/platform/src/streams_channel.dart
  • lib/src/push_notifications/src/admin/push_admin.dart
  • lib/src/push_notifications/src/admin/push_device_registrations.dart
  • lib/src/push_notifications/src/device_details.dart
  • lib/src/push_notifications/src/device_push_details.dart
  • lib/src/push_notifications/src/device_push_state.dart
  • lib/src/push_notifications/src/device_registration_params.dart
  • lib/src/push_notifications/src/ios_notification_settings.dart
  • lib/src/push_notifications/src/local_device.dart
  • lib/src/push_notifications/src/notification.dart
  • lib/src/push_notifications/src/push.dart
  • lib/src/push_notifications/src/push_activation_events.dart
  • lib/src/push_notifications/src/push_channel.dart
  • lib/src/push_notifications/src/push_channel_params.dart
  • lib/src/push_notifications/src/push_channel_subscription_params.dart
  • lib/src/push_notifications/src/push_channel_subscriptions.dart
  • lib/src/push_notifications/src/push_notification_events.dart
  • lib/src/push_notifications/src/remote_message.dart
  • lib/src/realtime/src/channel_event.dart
  • lib/src/realtime/src/channel_mode.dart
  • lib/src/realtime/src/channel_state.dart
  • lib/src/realtime/src/channel_state_event.dart
  • lib/src/realtime/src/connection_event.dart
  • lib/src/realtime/src/connection_state.dart
  • lib/src/realtime/src/connection_state_change.dart
  • lib/src/realtime/src/realtime_auth.dart
  • lib/src/realtime/src/realtime_channel_options.dart
  • lib/src/realtime/src/realtime_history_params.dart
  • lib/src/realtime/src/realtime_presence_params.dart
  • lib/src/rest/rest.dart
  • lib/src/rest/src/rest_auth.dart
  • lib/src/rest/src/rest_channel_options.dart
  • lib/src/rest/src/rest_history_params.dart
  • lib/src/rest/src/rest_presence_params.dart
  • lib/src/stats/src/stats.dart
  • lib/src/stats/src/stats_connection_types.dart
  • lib/src/stats/src/stats_message_traffic.dart
  • lib/src/stats/src/stats_message_types.dart
  • pubspec.yaml
  • test/ably_pubsub_device_flutter_plugin_test.dart
  • test/mock_method_call_manager.dart
  • test/models/client_options.dart
  • test/models/message_test.dart
  • test/models/presence_message_test.dart
  • test/platform/info_test.dart
  • test/realtime/channel_test.dart
  • test/realtime/channels_test.dart
  • test/rest/channel_test.dart
  • test/stable_id_generator_test.dart
  • test_integration/lib/app_provisioning.dart
  • test_integration/lib/config/test_factory.dart
  • test_integration/lib/config/test_names.dart
  • test_integration/lib/test/basic_test.dart
  • test_integration/lib/test/crypto/crypto_ensure_supported_key_length_test.dart
  • test_integration/lib/test/crypto/crypto_generate_random_key_test.dart
  • test_integration/lib/test/crypto/crypto_get_default_params.dart
  • test_integration/lib/test/realtime/realtime_auth_client_id_test.dart
  • test_integration/lib/test/realtime/realtime_auth_url_test.dart
  • test_integration/lib/test/realtime/realtime_authorize_test.dart
  • test_integration/lib/test/realtime/realtime_encrypted_publish_test.dart
  • test_integration/lib/test/realtime/realtime_events_test.dart
  • test_integration/lib/test/realtime/realtime_history_test.dart
  • test_integration/lib/test/realtime/realtime_history_with_auth_callback_test.dart
  • test_integration/lib/test/realtime/realtime_presence_enter_update_leave.dart
  • test_integration/lib/test/realtime/realtime_presence_get.dart
  • test_integration/lib/test/realtime/realtime_presence_history_test.dart
  • test_integration/lib/test/realtime/realtime_presence_subscribe.dart
  • test_integration/lib/test/realtime/realtime_publish_test.dart
  • test_integration/lib/test/realtime/realtime_publish_with_auth_callback_test.dart
  • test_integration/lib/test/realtime/realtime_subscribe.dart
  • test_integration/lib/test/realtime/realtime_time_test.dart
  • test_integration/lib/test/rest/rest_auth_client_id_test.dart
  • test_integration/lib/test/rest/rest_authorize_test.dart
  • test_integration/lib/test/rest/rest_capability_test.dart
  • test_integration/lib/test/rest/rest_create_token_request_test.dart
  • test_integration/lib/test/rest/rest_encrypted_publish_test.dart
  • test_integration/lib/test/rest/rest_history_test.dart
  • test_integration/lib/test/rest/rest_history_with_auth_callback_test.dart
  • test_integration/lib/test/rest/rest_presence_get_test.dart
  • test_integration/lib/test/rest/rest_presence_history_test.dart
  • test_integration/lib/test/rest/rest_publish_test.dart
  • test_integration/lib/test/rest/rest_publish_with_auth_callback_test.dart
  • test_integration/lib/test/rest/rest_request_token_test.dart
  • test_integration/lib/test/rest/rest_time_test.dart
  • test_integration/lib/test_dispatcher.dart
  • test_integration/lib/utils/encoders.dart
  • test_integration/lib/utils/realtime.dart
  • test_integration/lib/utils/rest.dart
  • test_integration/pubspec.yaml
  • test_integration/test_driver/test_implementation/crypto_tests.dart
  • test_integration/test_driver/test_implementation/rest_tests.dart
  • test_integration/test_driver/tests_config.dart

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Following the rename of this SDK to Ably Pub/Sub, rename the published
Dart package from `ably_flutter` to `ably_pubsub_device_flutter`, so the
package name matches the product.

The rename reaches further than `pubspec.yaml` because several names are
derived from the package name:

 - The library entry point moves to `lib/ably_pubsub_device_flutter.dart`,
   and every `package:ably_flutter/…` import follows. Import blocks are
   re-sorted where the new name changes their alphabetical order.

 - Flutter resolves a plugin's podspec by package name, so the podspec is
   renamed too. That in turn renames the Swift module, so the ObjC sources
   now import `<ably_pubsub_device_flutter/…-Swift.h>`, and the iOS CI job
   builds the `ably_pubsub_device_flutter-Unit-Tests` scheme CocoaPods
   generates from it.

 - `android/settings.gradle` names the Gradle project, and the example's
   Xcode project names the framework it embeds.

Both `Podfile.lock`s are regenerated with `pod install` so their spec
checksums are real, and the three `pubspec.lock`s with `flutter pub get`.

Method channel names and the `io.ably.ably_flutter.PUSH_*` broadcast
actions keep their current values, as wire identifiers shared with the
platform side. The example, integration test and test harness packages
keep their own names.

`UPDATING.md` gains a migration note covering the dependency, the import
path and the iOS module.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ttypic and others added 3 commits September 21, 2026 20:40
Following the rename of this SDK to Ably Pub/Sub, and the removal of the
REST client, the single remaining client is renamed from `Realtime` to
`PubSubClient` to match the product name. The declaring file moves to
`pub_sub_client.dart` accordingly.

Only the class is renamed. The `realtime` properties on `Connection`,
`RealtimeChannel`, `RealtimeChannels`, `Push` and `PushChannel`, the
`realtimeInstances` getter, and the platform channel method names all
keep their current names.

Unit and integration tests are updated to construct `PubSubClient`; they
cover the same behaviour as before. `UPDATING.md` gains a migration note
for the new name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Make `PubSubClient`'s constructor private and expose a single top-level
`createClient({required ClientOptions options})` function as the only way
to obtain a client. A factory function keeps the construction path open
for future changes — validation, caching, returning a subtype — without
another breaking change to the public surface.

This also removes the two key shorthands, `PubSubClient.fromKey(key)` and
the `key` parameter. They duplicated `ClientOptions(key: ...)`, which
`fromKey` delegated to anyway, and the either/or `options`/`key`
signature was only enforced by an assert. Callers now pass the key
through `ClientOptions`, so behaviour is unchanged. The four call sites
that passed both `options` and `key` keep only `options`, which is what
took effect before.

`options` becomes a final field, as it is now always set at construction.

Unit and integration tests construct clients through `createClient` and
cover the same behaviour as before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Clear out the API that earlier versions marked deprecated, now that a
major release allows it:

 - `Connection.recoveryKey`, superseded by `createRecoveryKey()`.
 - `ClientOptions.logHandler` and the `LogHandler` typedef. These never
   did anything — the codec carried a `TODO handle logHandler` where the
   encoding would have gone, and log output is handled by the underlying
   native SDK.
 - `ClientOptions.fallbackHostsUseDefault`, which had no replacement.
 - `ClientOptions.fromKey()` and `AuthOptions.fromKey()`, superseded by
   the constructors' named `key` parameter.

`fallbackHostsUseDefault` was plumbed over the platform channel, so it
also goes from `bin/codegen_context.dart` — regenerating the Dart, Java
and Obj-C constants — from the Dart codec, and from the Java and Obj-C
readers. Dropping the Obj-C read removes the deprecation warning
ably-cocoa emitted for that property.

Three doc comments referred to members this commit deletes, and are
rewritten to describe what replaces them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
SimonWoolf and others added 2 commits October 13, 2026 15:38
Spec 6.3.0 replaces RTS4a, under which release() detaches a channel that
is not already INITIALIZED, DETACHED or FAILED before removing it, with
RTS4c-e: release() of a channel in any other state must fail with error
90011 and leave the channel in place. That check is done by the
platform SDKs (ably-java, ably-cocoa) in their next major versions.

release() previously fired the platform call without awaiting it and
dropped the Dart-side channel unconditionally, so a platform error would
have been lost as an unhandled async error while the Dart and platform
collections diverged. It now returns a Future that completes with the
platform's AblyException, and only removes the Dart-side channel once the
platform release has succeeded. The state check is deliberately left to
the platform SDK, because RealtimeChannel.state is updated asynchronously
from platform events and so can lag behind the platform channel's state.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Rename to PubSubClient, drop deprecated methods
feat!: make RealtimeChannels.release() async and surface platform errors

This branch was successfully deployed

2 active (outdated) deployments
staging/pull/606/dartdoc — 768b17ca Deployed Oct 19, 2026 by github-actions[bot]
staging/pull/606/features — 768b17ca Deployed Oct 19, 2026 by github-actions[bot]
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