ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

LiveObjects SYNC sequence tests

Open VeskeR opened this issue 4 months ago • 1 comments

This PR is based on https://github.com/ably/ably-js/pull/1891, please review it first.

Adds LiveObjects integration tests for functionality introduced in https://github.com/ably/ably-js/pull/1887, https://github.com/ably/ably-js/pull/1890 and https://github.com/ably/ably-js/pull/1891.

NOTE: next Live Objects tests are expected to fail until https://ably.atlassian.net/browse/DTP-982 is fixed:

  • builds state object tree from STATE_SYNC sequence on channel attachment
  • LiveMap is initialized with initial value from STATE_SYNC sequence
  • LiveMaps can reference the same object in their keys

Failure is due to missing state object in STATE_SYNC sequence for a map which has zero values.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a size() method to the LiveMap class for retrieving the size of the data map.
    • Added a new live_objects_helper dependency for testing.
    • Implemented a LiveObjectsHelper class to manage LiveObjects state on channels.
    • Added a feature flag enableChannelState for new app creation.
    • Enhanced the test suite with a new helper function for channel options related to LiveObjects.
  • Bug Fixes

    • Improved error handling in the test suite for scenarios when the LiveObjects plugin is absent.
  • Documentation

    • Updated test suite structure for improved clarity and maintainability.

VeskeR avatar Oct 16 '24 08:10 VeskeR