Skip to content

Conversation

@SimonWoolf
Copy link
Member

As agreed and implemented in
ably/sdk-api-reference#44 (comment) . Which was before I merged that repo into this, so this change is already made in api-docstrings.md, but needs to be made in the features spec too

This is technically a breaking change, but probably fine to just edit in-place (without changing the api version) since we don't yet have any public functionality that depends on the message action, and we're not planning on making serverside behaviour switch on api version, we're just going to make the change and have the chat sdk (which is what needs this) depend on new enough versions of released sdks

As agreed and implemented in
ably/sdk-api-reference#44 (comment) ,
which was before I merged that repo into this, so the change is already made in
api-docstrings.md but needs to be made in the features spec too

This is technically a breaking change, but probably fine to just edit in-place
(without changing the api version) since we don't yet have any public
functionality that depends on the message action, and we're not planning on
making serverside behaviour switch on api version, we're just going to make the
change and have the chat sdk (which is what needs this) depend on new enough
versions of released sdks
@SimonWoolf SimonWoolf requested a review from ttypic January 8, 2025 12:50
SimonWoolf added a commit to ably/ably-java that referenced this pull request Jan 8, 2025
SimonWoolf added a commit to ably/ably-cocoa that referenced this pull request Jan 8, 2025
SimonWoolf added a commit to ably/ably-java that referenced this pull request Jan 8, 2025
SimonWoolf added a commit to ably/ably-java that referenced this pull request Jan 8, 2025
umair-ably added a commit to ably/ably-cocoa that referenced this pull request Jan 9, 2025
SimonWoolf added a commit to ably/ably-cocoa that referenced this pull request Jan 9, 2025
@SimonWoolf SimonWoolf merged commit dcec5a7 into main Jan 9, 2025
2 checks passed
@SimonWoolf SimonWoolf deleted the message-action-updates branch January 9, 2025 14:10
shwetha-manvinkurke added a commit to HubSpot/ably-java that referenced this pull request Aug 26, 2025
* tests: Assert connection error code rather than message

The error messages are subject to change, but the codes are not, so
assert the code instead.

Signed-off-by: Lewis Marshall <[email protected]>

* ci: enable workflow_dispatch

* Added attachOnSubscribe option to ChannelOptions

* Added attachOnSubscribe check before implicit attach on channel subscribe

* Added extra null channelOptions check while checking for attachOnSubscribe

* Fixed spec annotations for the attachOnSubscribe usecases

* Added tests for channel/presence subscribe without implicit attach

* Refactored attachOnSubscribe code, spec and related tests as per rabbitcodeai comments

* Bumped up library version, needed for new release

* Updated CHANGELOG

* chore: rearrange code before refactoring

* chore: update gradle wrapper

* refactor: decouple HTTP and WebSocket engines

- Extracted HTTP calls and WebSocket listeners into a separate module.
- Introduced an abstraction layer for easier implementation swapping.

* feat: OkHttp implementation for making HTTP calls and WebSocket connections

* feat: switch http client implementation based on gradle property

* feat: add automatic test retries

* chore: rename `isPingListenerSupported` method

* fix: integration tests for OkHttp realtime tests

* feat: introduced retry rules for flaky android push tests

* docs: add http engine in-code docs

Also add algorithm how to add new engine in the `CONTRIBUTING.md` guide

* chore: bump version number

* chore: update `CHANGELOG.md`

* Fixed incorrect spec annotations used for channel message subscribe and related tests

* Fixed presence subscribe when attachOnSubscribe=false, updated tests for the same

* [ECO-5033] fix: race condition when calling`AblyRealtime#connect()` on terminated state

* Removed finally block that closes ably client, instead used try with resources

* chore: bump version number

* chore: update `CHANGELOG.md`

* Added missing channel state check cases for attach and detach

* Added tests for channel state checks before attach and detach operations

* Bumped up ably-java version to 1.2.45

* Updated CHANGELOG

* [ECO-5139] feat: add `action` and `serial` fields
Add 256 bit AES CBC encrypted variable length data generated by Java client library SDK (ably#49)

* chore: bump version number

* chore: update `CHANGELOG.md`

* [ECO-5163] fix: duplicated messages because of duplicated attach message

* chore: bump version number

* chore: update `CHANGELOG.md`

* chore: add manual release GitHub action

* fix: temporary disable published release check

* chore: update release job

compare `VERSION_NAME` and tag before publishing

* [ECO-5172][RTL13] Fix existing impl. for server sent DETACH
1. Removed use of explicitly setting detached state
2. Fixed attachWithTimeout method call, set forcedAttach flag to true
3. Updated tests to track channel state changes on server sent DETACH

* [ECO-5117][RTL5] Fix missing spec implementation for channel detach (RTL5g)
1. Added missing callCompletionListenerError when detachImpl throws exception
on invalid connection state
2. Added separate test case for the spec RTL5g
3. Annotated channel detach tests with appropriate spec

* MessageAction enum changes

per ably/specification#263

* [ECO-5117][RTL13a] Fixed channel ATTACHING event detach err
1. Updated `attachWithTimeout` and `attachImpl` method to accept attachReason param
2. Updated test assertions for spec RTL13a accordingly

* chore: bump version number

* chore: update `CHANGELOG.md`

* [ECO-5193][TM*] Updated innner Message class
1. Added missing fields for refSerial, refType and Operation
2. Added serialization and deserialization for above fields using msgpack
3. Added serialization and deserialization for above fields using gson

* [ECO-5193][TM*] Added unit tests to MessageTest
1. Added serializer test for fields refSerial, refType and Operation
2. Added deserializer test for fields refSerial, refType and Operation
3. Added msgpack unit test for Message class

* [ECO-5193][TM*] Added test helper for Chat message edit, update and delete
1. Added ChatRoom class that provides methods tosend, update and delete the given messsage
2. Added test to check for message publish using REST API

* [ECO-5193][TM*] Updated Message.java
1. Changed metadata type from Map<String, String> to JsonObject,
2. Updated relevant tests, added missing assertions

* [ECO-5193][TM*] Updated ChaneMessagesTest.java
1. Added test to check for updated room message

* [ECO-5193][TM*] Updated Message.java
1. Reverted operation metadata to hashmap<string, string>
2. Updated relevant tests for the same

* [ECO-5193][TM*] Updated ChaneMessagesTest.java
- Updated assertions for test_room_message_is_updated test
- Added assertions to check if operation field is populated properly with
clientId, description and metadata

* [ECO-5193][TM*] Updated ChaneMessagesTest.java, implemented message delete test

* [ECO-5193][TM*] Updated ChaneMessagesTest.java
1. Implemented integration test for message create, update and delete serially.
2. Implemented integration test to check for allowed ops on deleted message.

* [ECO-5193][TM*] Fixed Message.Operation.write method for msgpack, updated ChatRoom public methods

* chore: upgrade github actions versions

* bumped up version to 1.2.49

* Updated CHANGELOG

* docs: update CONTRIBUTING.md guide for releasing process

* feat: kotlin wrapper for `ably-java` and `ably-android`

This is the initial version of the Kotlin wrapper for `ably-java` and `ably-android`. The main goal is to provide an extendable public interface for the Ably PubSub SDK (the core SDK for Chat and other products). This wrapper SDK is the first step toward modernizing our libraries. It introduces a set of interfaces that can be modified, for example, to inject agent information or other data when used within new product SDKs.

Note: In this PR we are not going to provide fully updated and idiomatic public API for `ably-java` and `ably-android`, this is the initial step of public API modernization, we will continue working on this.

* feat: Rest and Realtime clients adapters

Adapters for the Kotlin API for `ably-java` and `ably-android`

* chore: interface update

- make ErrorReason on the channel nullable
- improve docstrings

* Implement TM2p change (no message version populating from channelmessage)

Implements ably/specification#275

* [CHAT-5063] feat: sdk proxy wrapper for agent tracking (java)

- we introduced several package-private methods that make it possible to use custom http module to invoke Rest API

We want to be able to distinguish requests made inside the wrapper from those made by the core PubSub SDK without the wrapper, allowing us to track agents across wrapper SDKs such as the Chat SDK or Asset Tracking. To achieve this, we introduce special proxy Realtime and Rest clients that inject additional agents parameters into the underlying SDK.

* [CHAT-5063] feat: add `createWrapperSdkProxy` for kotlin adapters SDKs

Special `SdkWrapperCompatible` introduced, allowing us to hide `createWrapperSdkProxy` from the public interface and use extension function instead

* [CHAT-5063] feat: inject agents into `ChannelOptions` as well

* [CHAT-5063] feat: add tests for agent propagation

Add tests to verify agent propagation in the WrapperSdkProxy clients

* [CHAT-5063] refactor: make implicit calls overrides instead of patching client

* [CHAT-5228] fix: add lombok to ProGuard rules

We use Lombok for code generation but Lombok itself should not be included in the final APK.

Effect of `-dontwarn lombok.**`:
- It tells ProGuard to ignore missing Lombok classes, preventing unnecessary warnings.
- This avoids potential build failures when ProGuard is set to treat warnings as errors.

* [CHAT-5063] feat: expose unwrapped java classes in the adapter

* chore: bump version number

* chore: update `CHANGELOG.md`

* chore: turn on `explicitApi` for kotlin module

Although the `pubsub-adapter` module is currently completely internal and not ready to be exposed, we expect this to change. That’s why we plan to provide a well-designed public API while ensuring that unnecessary details remain hidden.

* fix: wrap unhandled request exceptions into `AblyException`

During the `HttpCore` refactoring, some exceptions that were previously wrapped in checked `AblyException` exceptions were instead wrapped in `RealtimeException`. As a result, code that handled these exceptions may behave differently, since checked exceptions ensure that an exception handler is in place. This commit restores the original behavior

* [ECO-5248] fix: make query params URL encoded

Fixed inconsistent encoding/decoding in HTTP requests. Value of `Param` object shouldn't be URL encoded, but if it used in as query params it should be URL encoded in the request.

* [ECO-5246] fix: Realtime Client Reconnection Logic

Previously, we cleared all channels on the close event, causing all previously acquired channels to become orphaned. We have now removed this logic and fixed the reconnection behavior to align with the spec

* chore: bump version number

* chore: update `CHANGELOG.md`

* fix: deadlock in `WebSocket.close()`

The `Java-WebSocket` library holds a lock while invoking listeners, and when a connection is terminated ungracefully, it can cause a deadlock. Here’s an explanation:

- The **WebSocketLibrary**’s connection checker thread executes `WebSocket.close()`.
- The **WebSocketLibrary** acquires a lock and starts invoking listeners while holding the lock.
- The **WebSocketHandler** has an internal Timer that holds a lock on the handler. This Timer decides to close the connection as well and calls `WebSocket.close()` while holding the lock.
- The **WebSocketLibrary** tries to dispose of the **Timer**  but can’t because the **Timer**  holds the lock.
- The **Timer**  tries to close the connection but can’t because the  **WebSocketLibrary** still holds the lock.

There are two issues here:

1. The **WebSocketLibrary** shouldn’t hold a lock while calling listeners.
2. The **Timer** shouldn’t hold a lock while calling `close()`.

We can’t fix the first issue, which is why we need to address the second one.

* chore: bump version number

* chore: update `CHANGELOG.md`

* Rename action META_OCCUPANCY->META

ably/specification@35bbeb7

Technically a breaking change. We're not considering it such because
`Message.action` was only introduced recently as part of the
annotations/materialization work, which isn't yet part of a publicly
released feature yet, and isn't added to our [main
documentation](https://ably.com/docs/api/realtime-sdk/types#message). So
it's just very unlikely that anyone is relying on the action yet. Our
inband occupancy events docs still all say to use the message name,
which is not changing.

* Created and configured liveobjects as a separate module to the project
1. Declared required liveobject java interfaces
2. Implemented liveobject interface for LiveObjectsPlugin
3. Declared batch specific public interface methods

* 1. Added jetbrains-annoations dependency to clearly define interface methods
2. Added internet connectivity check to test setup

* 1. Updated public doc for LiveObjects, LiveMap and LiveCounter
2. Added live objects specific channel modes and flags to protocol message

* 1. Added coroutinex as a runtime and test dependency to liveobjects
2. Added bridging interfaces to send and receive protocol messages
3. Added impl. for dispose method

* 1. Added blocking and non-blocking annotations to sync and async methods
2. Removed liveobject batching operation specific interfaces

* [ECO-5375] Refactored LiveObjects plugin to handle channelSerial

* [ECO-5375] Created ObjectMessage.kt, declared data classes as per spec

* [ECO-5375] Updated code as per review comments
1. Updated enum ObjectOperationAction with PascalCase values
2. Created separate file for adapter that extends LiveObjectsAdapter
3. Added custom Binary type to handle ByteArray values

* [ECO-5375] Updated liveObjectsAdapter sendAsync method to use suspendCancellableCoroutine

* [ECO-5338] Created tests package for liveobjects
1. Added test specific dependencies, updated junit, added mockk
2. Added test utils for mocking private classes, fields etc
3. Added IntegrationTest parameterized class along with sample test
4. Added sample unit test along with mocked realtime channel

* [ECO-5338] Updated CI scripts to run liveobject plugin tests
1. Updated separate gradlew task for both unit and integration tests
2. Updated check.yml and integration-test.yml file to run respective tests

* [ECO-5338] Fixed liveobject test dependency, utils as per review comments

* [ECO-5338] Fixed liveobject test dependency
1. Fixed liveobject channel options while initializing test channel
2. Fixed test utils as per review comments
3. Fixed adapter NotNull annotation for send method

* chore: delete git module since it's not used in ably-java

* chore: fix access to ably-commons data

* [ECO-5380] Added size method to ObjectMessage, core SDK Message
1. Added size method to inner data field classes
2. Annotated size calculation with respective spec

* [ECO-5380] Updated message size spec annoatations as per updated spec

* [ECO-5380] Updated LiveObjectsAdaopter interface
1. Added and implemented method to calculate maxMessageSizeLimit
2. Added extension method ensureMessageSizeWithinLimit to validate object msg sizes
3. Added unit test to validate objectMessageSizeWithinLimit

* chore: bump version number

* chore: update `CHANGELOG.md`

* [ECO-5380] Create separated unit test file for ObjectMessage
1. Added three different unit tests covering edge cases
2. Updated doc for byteSize String extension method
3. Updated type of maxMessageSize to int instead of long

* [ECO-5386] Added interfaces for liveobject serialization
1. Added LiveObjectSerializer interface consisting methods for json and msgpack
serialization.
2. Added LiveObjectsHelper to initialize LiveObjectsPlugin and LiveObjectSerializer
3. Updated code to use LiveObjectSerializer and LiveObjectsHelper to serialize
and initialize liveobjects

* [ECO-5386] Added impl. for LiveObjectSerializer interface
1. Implemented JsonSerializetion using gson library
2. Implemented MsgpackSerialization without external dependency
3. Annotated/updated ObjectMessage fields for gson serialization
4. Added msgpack dependency to liveobjects

* [ECO-5386] Added unit tests for Liveobject serialization
1. Created dummy objectmessage fixture for different data types
2. Implemented unit tests with given fixture for various cases

* [ECO-5386] Fixed serialization and related helpers as per review comments

* [ECO-5421] Removed initialValueEncoding field, updated initialValue to string type

* [ECO-5430] fix: npe in the connectivity check

- Throw `AblyException` for empty response bodies.
- Added corresponding unit tests to validate behavior.

* [ECO-5426][ECO-5439] Initialize live objects foundation with core interfaces
- Enhanced LiveCounter interface with increment/decrement operations and comprehensive JavaDoc
- Extended LiveObjectsPlugin interface for modular plugin architecture
- Updated ErrorCodes enum for standardized live objects error handling
- Established blocking/non-blocking operation annotations for API consistency

* [ECO-5426][ECO-5439] Implement object utilities and validation framework
- Created ObjectId class with comprehensive validation and parsing logic
- Enhanced Utils helper functions for common object operations
- Updated Helpers class for shared live objects functionality
- Established consistent logging patterns and error handling across components

* [ECO-5426][ECO-5439] Establish plugin architecture and live objects core
- Enhanced DefaultLiveObjectsPlugin with seamless channel integration
- Updated DefaultLiveObjects with coroutine-based sequential message processing
- Added objects pool initialization and comprehensive lifecycle management
- Implemented channel state change handling for live objects synchronization

* [ECO-5426][ECO-5439] Implement base live object with comprehensive testing
- Added BaseLiveObject abstract class as foundation for LiveMap/LiveCounter
- Implemented site timeserials tracking and tombstone lifecycle management
- Created BaseLiveObjectTest with spec-compliant validation and edge cases
- Established thread-safe object state management and operation handling

* Apply suggestions from code review for ObjectOperation#initialValue

Co-authored-by: Andrew Bulat <[email protected]>

* [ECO-5426][ECO-5439] Design object message structure with validation system
- Enhanced ObjectMessage data class with complete serialization field mapping
- Created comprehensive ObjectId validation with extensive test coverage
- Added message size calculation and validation logic for protocol compliance
- Established edge case testing for object ID formats and parsing scenarios

* [ECO-5426][ECO-5439] Establish comprehensive test infrastructure
- Enhanced TestUtils with advanced mock object generation capabilities
- Updated TestHelpers with channel and adapter mocking for integration tests
- Added parameterized test base classes for systematic integration testing
- Established consistent test patterns and mock factories for all live object types

* [ECO-5426][ECO-5439] Implement thread-safe objects pool with lifecycle management
- Added ObjectsPool with ConcurrentHashMap for thread-safe object storage
- Implemented automatic garbage collection for tombstoned objects
- Created pool initialization with root object and comprehensive lifecycle management
- Added extensive ObjectsPoolTest with concurrent access validation and edge cases

* [ECO-5426][ECO-5439] Create objects manager for sync and operation processing
- Implemented ObjectsManager for OBJECT and OBJECT_SYNC message processing
- Added sync objects data pool for collecting and managing sync sequences
- Created buffered object operations during sync state with proper ordering
- Established comprehensive ObjectsManagerTest with sync sequence validation scenarios

* [ECO-5426][ECO-5439] Implement sync tracking system with state transitions
- Added ObjectsSyncTracker for managing sync sequences and cursor tracking
- Implemented sync state transitions and channel serial management
- Created comprehensive sync tracking tests with edge case coverage
- Established sync completion detection and buffered operation processing logic

* [ECO-5426][ECO-5439] Design LiveMap entry system with test fixtures
- Created LiveMapEntry with timestamp and value management for conflict resolution
- Enhanced ObjectMessageFixtures for consistent test data generation across test suites
- Added entry lifecycle management with tombstone support and GC integration
- Established fixture patterns for various object message scenarios and edge cases

* [ECO-5457] Refactored ObjectsStateSubscription to ObjectsSubscription

- Added ObjectsStateEvent enum for SYNCING and SYNCED states
- Created ObjectsStateChange interface with listener pattern for state changes
- Implemented ObjectsSubscription interface for subscription management
- Added ObjectsState enum and coordination system with internal/external event emitters
- Created HandlesObjectsStateChange interface for state management coordination

* [ECO-5426][ECO-5439] Implement LiveMap core functionality and operations
- Added DefaultLiveMap with ConcurrentHashMap for thread-safe map operations
- Implemented map semantics support (LWW) and comprehensive entry management
- Created essential LiveMap operations (get, set, remove, size) with validation
- Established DefaultLiveMapTest with fundamental operation validation and concurrency tests

* [ECO-5450] fix: async connection state transition side effects

Side effects for close and reconnect were invoked asynchronously on a different thread, so the sequence of operations: `client.close(); client.connect(); channel.attach();` produced unexpected results, with the channel ending up in the initialized state instead of attaching.

To fix this, we now proactively reset the connection and channel states. If `connect()` is called while in a terminal state, we can synchronously clear channel states.

Additionally, we need to handle the case where `close()` is called but the connection has not yet transitioned to the closing state, and `connect()` is invoked immediately afterward. In this situation, it is also safe to detach from channels and clean up their state.

* [ECO-5076] Updated impl. to dispose objects using ablyexception

- Added getChannelModes and getChannelState methods to LiveObjectsAdapter interface
- Implemented channel mode retrieval with fallback from channel options (RTO2a, RTO2b)
- Enhanced LiveObjectsPlugin interface with disposal lifecycle documentation
- Fixed DefaultLiveObjectsPlugin to use clientError for proper exception handling
- Updated Adapter class with channel state and mode management functionality

* [ECO-5426][ECO-5439] Create LiveMap manager for advanced operation processing
- Implemented LiveMapManager for handling complex map operations and state management
- Added operation validation and conflict resolution logic with LWW semantics
- Created comprehensive LiveMapManagerTest with operation scenarios and edge cases
- Established map update calculation and change notification system for subscribers

* fix: reset `msgSerial` on reconnect after suspension

- Ensure `msgSerial` is reset to `0` when reconnecting from the suspended state.
- Added a unit test to verify this behavior.

* fix: move serializer initialization inside methods

it prevents SDK from immediately posting an error log message about not having LiveObject installed

* [ECO-5457] Replaced GlobalCallbackScope with ObjectsCallbackScope with lifecycle tied to given objects instance

- Added channel mode and state validation error codes (ChannelModeRequired, ChannelStateError)
- Implemented throwIfInvalidAccessApiConfiguration with channel mode validation (RTO2)
- Created ObjectsAsyncScope for channel-specific async operations with proper error handling
- Added launchWithCallback and launchWithVoidCallback methods for safe async execution
- Enhanced validation helpers for channel state and mode requirements

* [ECO-5426][ECO-5439] Implement LiveCounter with atomic operations
- Added DefaultLiveCounter with AtomicReference for thread-safe counting operations
- Implemented counter operations (increment, decrement, value) with proper synchronization
- Created DefaultLiveCounterTest with concurrent operation validation and stress testing
- Established counter data management and operation result handling with notifications

* EDU 1942: Improve Pub/Sub Java Readme (ably#1088)

This PR streamlines and refocuses the content of README.md to improve
readability, simplify navigation, and make ongoing maintenance easier.

* chore: bump version number

* chore: update `CHANGELOG.md`

* chore: update Maven Publish plugin and fix publishing configuration

From 30 June `S01` and `oss.sonatype.com` are migrated to the `central.sonatype.com`

* [ECO-5458] Added base interface for live object updates

- Introduced LiveObjectUpdate interface as foundation for subscription system
- Provides common contract for all live object change notifications

* [ECO-5426][ECO-5439] Create LiveCounter manager for operation handling
- Implemented LiveCounterManager for counter-specific operations and state management
- Added counter operation validation and comprehensive state management logic
- Created extensive LiveCounterManagerTest with edge cases and error scenarios
- Established counter update calculation and notification system for real-time updates

* [ECO-5426] Refactored initializeHandlerForIncomingObjectMessages to handle exceptions

- Updated ObjectsManager to extend ObjectsStateCoordinator for state management
- Fixed state enum references from SYNCED/SYNCING to Synced/Syncing
- Added stateChange method with proper state transition logging (RTO2)
- Integrated state change event emission through ObjectsStateCoordinator
- Enhanced disposal process to include state listener cleanup
- Removed unused import from BaseLiveObject

* [ECO-5457] Refactored LiveCounter, implemented value method

- Updated LiveCounter#data type to AtomicLong to make it thread safe
- Replaced generic Callback with ObjectsCallback in async methods
- Implemented value() method with channel configuration validation
- Added proper adapter validation using throwIfInvalidAccessApiConfiguration
- Maintained thread-safe access to counter data through AtomicReference

* [ECO-5458] Implemented LiveCounter subscription interfaces

- Added LiveCounterChange interface for counter change notifications
- Created LiveCounterUpdate interface extending LiveObjectUpdate
- Defined comprehensive change event structure for counter subscriptions

* [ECO-5426][ECO-5439] Complete DefaultLiveObjects integration with testing
- Created comprehensive DefaultLiveObjectsTest with integration scenarios
- Added complete live objects lifecycle and state management validation
- Implemented channel state integration testing with various state transitions
- Established end-to-end workflow testing for live objects synchronization

* [ECO-5457] Refactored LiveMap to accept DefaultLiveObjects in constructor param

- Added channel state checks for detached and failed
- Implemented LiveMap accessor methods: get, entries, keys, values and size
- Updated LiveMap data field to be ConcurrentMap for thread safety
- Added proper channel configuration validation for all accessor methods
- Implemented sequence-based iteration for entries, keys, and values with tombstone filtering
- Replaced generic Callback with ObjectsCallback in async methods

* [ECO-5458] Implemented LiveMap subscription interfaces

- Added LiveMapChange interface for map change notifications
- Created LiveMapUpdate interface extending LiveObjectUpdate
- Defined comprehensive change event structure for map subscriptions

* [ECO-5426][ECO-5439] Implement JSON serialization with Gson integration
- Enhanced JsonSerialization with custom type adapters for enum serialization
- Improved ObjectMessage JSON serialization and deserialization with proper formatting
- Updated enum code type adapters for ObjectOperationAction and MapSemantics
- Established JSON object conversion utilities with comprehensive error handling

* [ECO-5426][ECO-5439] Create MessagePack serialization system
- Enhanced MsgpackSerialization for efficient binary message encoding
- Improved ObjectMessage MessagePack write and read operations with field optimization
- Updated DefaultLiveObjectSerializer supporting both JSON and MessagePack formats
- Established efficient binary serialization with minimal memory allocation

* [ECO-5076] Implemented code for getRoot method

- Added getChannelModes and getChannelState methods to adapter
- Implemented getRoot method with blocking and async variants using ObjectsAsyncScope
- Moved ObjectsState enum to separate file and updated state references
- Added proper disposal handling with AblyException instead of string reason
- Enhanced async scope management for callback operations
- Updated all async method signatures to use ObjectsCallback instead of Callback

* [ECO-5458] Moved LiveCounter and LiveMap to type-specific packages

- Moved LiveCounter.java to type/counter package for better organization
- Moved LiveMap.java to type/map package for better organization
- Updated import references in LiveObjects and ObjectsSubscription

* [ECO-5426][ECO-5439] Implement message serialization and size validation
- Enhanced ObjectMessageSerializationTest with comprehensive format validation
- Updated ObjectMessageSizeTest with size calculation validation and limits enforcement
- Improved message size calculation methods for all object message components
- Established size validation utilities with comprehensive test coverage and edge cases

* [ECO-5458] Implemented change coordinators for subscription management

- Added LiveCounterChangeCoordinator for counter subscription events
- Added LiveMapChangeCoordinator for map subscription events
- Provides centralized coordination for change notifications and listeners

* [ECO-5450] fix: async connection state transition side effects

- Added getOptions() method to ChannelBase for accessing channel options
- Initialize LiveObjects instance on channel creation to process sync messages
- Enhanced channel integration with LiveObjects plugin lifecycle management
- Fixed channel mode fallback logic by exposing channel options

* [ECO-5458] Enhanced LiveCounter with subscription support

- Updated BaseLiveObject with subscription coordination capabilities
- Modified DefaultLiveCounter to integrate with LiveCounterChangeCoordinator
- Enhanced LiveCounterManager to return LiveCounterUpdate objects

* [ECO-5426][ECO-5439] Integrate live objects with realtime channel system
- Enhanced ChannelBase to support live objects functionality with seamless integration
- Updated live objects protocol message handling in channel pipeline
- Improved channel state integration for live objects synchronization
- Established robust integration between channels and live objects with proper lifecycle

* [ECO-5426][ECO-5439] Renamed LiveObjectTest to RealtimeObjectsTest

* [ECO-5426] Added comprehensive unit tests for Live Objects core functionality

- Added UtilsTest with 283 lines of comprehensive utility function tests
- Enhanced DefaultLiveObjectsTest with updated state management tests
- Updated ObjectsManagerTest with improved sync sequence and state handling tests
- Created test coverage for ObjectId validation, state transitions, and error handling
- Added tests for ObjectsAsyncScope callback execution and error scenarios

* [ECO-5457] Renamed callbackScope to asyncScope for better context around async ops

- Enhanced IntegrationTest setup with improved test configuration
- Updated Sandbox configuration for integration test environment
- Improved test infrastructure for Live Objects integration testing
- Added better error handling and setup validation for integration tests

* [ECO-5458] Enhanced LiveMap with subscription support

- Modified DefaultLiveMap to integrate with LiveMapChangeCoordinator
- Enhanced LiveMapManager to return LiveMapUpdate objects
- Implemented comprehensive map change notification system

* [ECO-5482] Added realtime write API to LiveObjects core interfaces

- Enhanced LiveObjects interface with realtime write operations and spec annotations
- Extended Adapter and LiveObjectsAdapter with realtime write support
- Implemented foundational API structure for realtime object modifications

* [ECO-5482] Enhanced LiveCounter and LiveMap interfaces for realtime operations

- Updated LiveCounter interface with realtime write methods and spec references
- Modified LiveMap interface to support realtime write capabilities
- Added comprehensive API documentation for realtime operations

* [ECO-5458] Updated core LiveObjects implementation for subscriptions

- Modified DefaultLiveObjects to support subscription integration
- Enhanced Helpers with subscription-related utilities
- Updated ObjectsManager and ObjectsPool for subscription context

* [ECO-5457] Added integration tests LiveCounter accessors

- Created PayloadBuilder for constructing test payloads with 135 lines of functionality
- Added RestObjects helper with 119 lines for REST API integration testing
- Implemented CounterFixtures with test data for LiveCounter integration tests
- Created DataFixtures with 84 lines of common test data structures
- Added MapFixtures with 157 lines for LiveMap integration test scenarios
- Enhanced integration test utilities with comprehensive helper functions

* [ECO-5482] Added LiveMapValue class and ServerTime utility for realtime operations

- Implemented comprehensive LiveMapValue class for map value handling
- Added ServerTime utility for server timestamp management
- Provided foundational support classes for realtime write operations

* [ECO-5482] Implemented realtime write functionality in core LiveObjects

- Enhanced DefaultLiveObjects with realtime write operation implementations
- Updated Helpers with realtime write support utilities
- Modified Utils to support realtime operation context and validation

* [ECO-5458] Added comprehensive integration tests for subscriptions

- Enhanced DefaultLiveCounterTest with subscription test scenarios
- Updated DefaultLiveMapTest with subscription functionality tests
- Added subscription tests to DefaultLiveObjectsTest and helper utilities

* [ECO-5426] Updated ObjectValue to have compile time type safety instead of checking type at runtime

- Added DefaultLiveCounterTest with 205 lines of comprehensive integration tests
- Created DefaultLiveMapTest with 213 lines covering LiveMap integration scenarios
- Implemented test coverage for LiveCounter and LiveMap accessor methods
- Added integration tests for object state validation and error handling
- Enhanced test suite with real-time synchronization and state change validation

* [ECO-5482] Enhanced supporting components for realtime write operations

- Updated ObjectId with realtime operation support
- Modified ErrorCodes for realtime write error handling
- Enhanced MsgpackSerialization for realtime operation serialization
- Updated BaseLiveObject with realtime write base functionality

* [ECO-5482] Implemented realtime write operations in DefaultLiveCounter and DefaultLiveMap

- Added runBlocking synchronous wrappers for increment/decrement in DefaultLiveCounter
- Updated DefaultLiveMap.get() to return LiveMapValue instead of Any?
- Integrated asyncScope for coroutine-based realtime operations
- Added kotlinx.coroutines.runBlocking import for synchronous API support

* [ECO-5447] Enhanced object serialization with server-provided tombstone serial support

- Added tombstone serial tracking to ObjectMessage for server-provided serials
- Updated ObjectsManager to handle tombstone serial in object processing
- Enhanced MsgpackSerialization to support tombstone serial deserialization
- Modified BaseLiveObject to incorporate tombstone serial in state management

* [ECO-5482] Enhanced LiveMapEntry with additional imports for realtime operations

- Added imports for LiveCounter, LiveMap, LiveMapValue types
- Extended imports for BaseLiveObject and ObjectType support
- Updated LiveMapEntry to support enhanced type system for realtime write operations

* [ECO-5447] Updated LiveCounter and LiveMap managers for tombstone serial handling

- Modified DefaultLiveCounter to support server-provided tombstone serials
- Enhanced LiveCounterManager with tombstone serial processing logic
- Updated DefaultLiveMap to handle tombstone serial in map operations
- Improved LiveMapManager with comprehensive tombstone serial support

* [ECO-5458] Enhanced test fixtures and unit tests for subscription support

- Updated CounterFixtures and MapFixtures with subscription test data
- Enhanced IntegrationTest setup for subscription scenarios
- Added comprehensive unit tests for LiveCounterManager and LiveMapManager

* [ECO-5482] Enhanced integration tests for realtime write operations

- Updated DefaultLiveCounterTest with realtime write test scenarios
- Enhanced DefaultLiveMapTest with comprehensive realtime operation tests
- Added LiveMapValue import and removed unused type imports
- Expanded test coverage for realtime increment/decrement and map operations

* [ECO-5447] Added comprehensive integration tests for tombstone serial functionality

- Enhanced DefaultLiveObjectsTest with tombstone serial test scenarios
- Updated integration helpers with tombstone serial utilities
- Added TestHelpers support for tombstone serial testing
- Improved ObjectsManagerTest with tombstone serial validation

* [ECO-5482] Cleaned up imports and enhanced integration test helpers

- Removed unused imports from DefaultLiveObjectsTest (JsonArray, JsonObject, Binary)
- Updated PayloadBuilder helper for realtime write operation support
- Streamlined import statements for better code organization

* [ECO-5447] Enhanced unit tests with comprehensive tombstone serial coverage

- Added extensive unit tests for LiveCounterManager tombstone serial handling
- Enhanced LiveMapManagerTest with comprehensive tombstone serial scenarios
- Updated DefaultLiveCounterTest and DefaultLiveMapTest for tombstone serial validation
- Implemented thorough test coverage for server-provided tombstone serial functionality

* [ECO-5426][ECO-5439] Renamed LiveObjectTest to RealtimeObjectsTest

* [ECO-5506] Declared separate interface ObjectsCallback for async ops

- Added ObjectsCallback interface replacing generic Callback for Live Objects operations
- Updated LiveObjects interface to extend ObjectsStateChange and use ObjectsCallback
- Refactored LiveCounter and LiveMap async methods to use ObjectsCallback instead of Callback
- Added comprehensive Javadoc for ObjectsCallback with operation-specific guidance

* [ECO-5076] Fixed integration test fixtures in accordance with ObjectValue union type

- Added DefaultLiveObjectsTest with 187 lines of comprehensive Live Objects integration tests
- Implemented complete integration test suite covering getRoot functionality
- Enhanced test coverage for Objects state management and synchronization
- Added integration tests for ObjectsCallback interface and async operations
- Completed comprehensive test coverage for all Live Objects core functionality

* [ECO-5482] Added unit tests for for utilies

- Enhanced ObjectIdTest with testFromInitialValue test for object initialization
- Added new test methods to UtilsTest for realtime operation utilities
- Updated ObjectMessageSizeTest with realtime write operation size calculations

* [ECO-5383] Fixed build script to enable local maven publish

* [ECO-5383] Updated contributing guide for publishing specific module with precedence

* [ECO-5517] Implemented implicit attach for getRoot method
- Adjusted channel state checks prior to channel modes for read
and write objects operations
- Added getChannel method to adapter interface, added relevant ensureAttached
method with relevant implementation

* [ECO-5517] Removed implicit channel attach from integration test setup

* [ECO-5517] Refactored Adapter implementation, moved to liveobjects Helpers
- Removed unnecessary implementation from Adapter, made it clean
- Updated unit tests/mocks accordingly

* [ECO-5517] Added comprehensive unit tests for liveobjects Helpers

* [ECO-5418] Updated ObjectMessage.kt internal data classes with Objects prefix
- Renamed LiveObjects interface to RealtimeObjects
- Removed Live prefix from other interfaces, kept them with Objects*
- Removed use of liveobject keyword from the library since its reserved for
business use case

* [ECO-5418] Marked ObjectsPlugin field as Nullable in AblyRealtime
and RealtimeChannel classes

* chore[live-objects]: change `:java` dependency to `compileOnly` in `live-objects` module

live-objects can be used both with ably-java and ably-android, making dependency `compileOnly` we prevent adding specific module (ably-java or ably-android) to the classpath

* update to fatjar and exclude problematic deps

---------

Signed-off-by: Lewis Marshall <[email protected]>
Co-authored-by: Evgeny Khokhlov <[email protected]>
Co-authored-by: Lewis Marshall <[email protected]>
Co-authored-by: owenpearson <[email protected]>
Co-authored-by: Owen Pearson <[email protected]>
Co-authored-by: sacOO7 <[email protected]>
Co-authored-by: Simon Woolf <[email protected]>
Co-authored-by: Andrew Bulat <[email protected]>
Co-authored-by: Francis Roberts <[email protected]>
Co-authored-by: Shwetha Manuvinakurike <[email protected]>
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.

3 participants