Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: initial state sync #1936

Merged
merged 30 commits into from
Sep 9, 2024
Merged

Refactor: initial state sync #1936

merged 30 commits into from
Sep 9, 2024

Conversation

NickKhalow
Copy link
Contributor

@NickKhalow NickKhalow commented Aug 29, 2024

What does this PR change?

During the network issue research I made a refactor

  1. decodedMessage is handled in the base class CommunicationsControllerAPIImplementationBase and it's no more duplicated in both derived classes
  2. CommunicationsControllerAPIImplementationBase many fields turned to private, to reduce the scope of their possible usage
  3. EncodeAndSendMessage extracted to CommunicationsControllerAPIImplementationBase and reused
  4. WalletId renamed to FromWalletId to give more context of supposed usage of it
  5. ICommunicationControllerHub renamed to ISceneCommunicationPipe as it better describes the concern of the object
  6. Remove outward available List in ISDKMessageBusCommsControllerAPI
  7. Nullables to EngineApiWrapper
  8. ISDKObservableEventsEngineApi simplified, the spread logic from SDKObservableEventsEngineApiWrapper is moved to SDKObservableEventsEngineApi
  9. Removed unused dependencies fromSceneRuntimeImpl

...

How to test the changes?

  1. Launch the explorer
  2. Play happy path

Our Code Review Standards

https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md

Summary by CodeRabbit

  • New Features

    • Introduced additional GUID entries for improved assembly interactions.
    • Enhanced messaging capabilities with new using directives for ECS lifecycle and LiveKit functionalities.
  • Improvements

    • Refactored communication handling to utilize ISceneCommunicationPipe, enhancing clarity and functionality across multiple components.
    • Enhanced encapsulation of message lists in SDKMessageBusCommsAPIImplementation.
  • Bug Fixes

    • Updated message handling logic to streamline processing and improve clarity.
  • Tests

    • Updated test classes to reflect changes in communication handling, ensuring alignment with the new architecture.

@NickKhalow NickKhalow requested a review from mikhail-dcl August 29, 2024 08:27
@NickKhalow NickKhalow self-assigned this Aug 29, 2024
Copy link
Contributor

github-actions bot commented Aug 29, 2024

badge

New build in progress, come back later!

Copy link

coderabbitai bot commented Sep 2, 2024

Walkthrough

The changes involve a substantial refactoring of the communication systems within the project. Key updates include the addition of new GUIDs to assembly definitions, modifications to method signatures for improved clarity, and the introduction of new properties and methods to enhance data encapsulation. The overall structure aims to streamline communication processes and clarify the roles of various components in the system.

Changes

Files Change Summary
Explorer/Assets/DCL/Multiplayer/Connections/DCL.Multiplayer.Connections.asmdef Added three new GUIDs to the assembly definition.
Explorer/Assets/DCL/Multiplayer/Connections/Messaging/Hubs/MessagePipesHub.cs Reformatted constructor parameters for improved readability.
Explorer/Assets/DCL/Multiplayer/Connections/Messaging/Pipe/IMessagePipe.cs Added two using directives for ECS lifecycle and LiveKit room functionalities.
Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/... Significant refactoring in CommunicationsControllerAPIImplementation and CommunicationsControllerAPIImplementationBase, including parameter type changes and method signature updates for clearer message handling.
Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/... Renamed ICommunicationControllerHub to ISceneCommunicationPipe and modified related structures for clarity and improved scene communication handling.
Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/... Refactored SDKMessageBusCommsAPIImplementation to enhance encapsulation and streamline message handling processes.
Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/... Updated tests to reflect the new communication pipe structure, replacing old references and ensuring consistency with the refactored classes.
Explorer/Assets/Scripts/SceneRunner/... Various changes to scene management classes, including updates to communication handling and the introduction of new properties for scene data access.
Explorer/Assets/Scripts/SceneRunner/SceneInstanceDeps.cs Adjusted constructor parameters across multiple classes to reflect the shift from ICommunicationControllerHub to ISceneCommunicationPipe.

Sequence Diagram(s)

sequenceDiagram
    participant A as Client
    participant B as SceneCommunicationPipe
    participant C as SDKObservableEventsEngineApiWrapper

    A->>B: Send message
    B->>C: Process message
    C->>B: Acknowledge receipt
    B->>A: Confirm delivery
Loading

🐰 "In the meadow, changes bloom,
New pipes and messages, making room.
With hops of joy, we celebrate,
A clearer path, oh, isn't it great?
From whispers soft to echoes bright,
Our world of code takes joyful flight!" 🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 22b2ff6 and be1b682.

Files selected for processing (27)
  • Explorer/Assets/DCL/Multiplayer/Connections/DCL.Multiplayer.Connections.asmdef (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Connections/Messaging/Hubs/MessagePipesHub.cs (1 hunks)
  • Explorer/Assets/DCL/Multiplayer/Connections/Messaging/Pipe/IMessagePipe.cs (1 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementation.cs (3 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs (5 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/ISceneCommunicationPipe.cs (2 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SDKMessageBus/SDKMessageBusCommsAPIImplementation.cs (1 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SceneCommunicationPipe.cs (2 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/SDKObservableEventsEngineAPIImplementation.cs (8 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs (5 hunks)
  • Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs (1 hunks)
  • Explorer/Assets/Scripts/Global/SceneSharedContainer.cs (1 hunks)
  • Explorer/Assets/Scripts/SceneRunner/EmptyScene/EmptySceneFacade.cs (2 hunks)
  • Explorer/Assets/Scripts/SceneRunner/Scene/ISceneFacade.cs (1 hunks)
  • Explorer/Assets/Scripts/SceneRunner/SceneFactory.cs (2 hunks)
  • Explorer/Assets/Scripts/SceneRunner/SceneInstanceDeps.cs (3 hunks)
  • Explorer/Assets/Scripts/SceneRunner/Tests/SceneFacadeShould.cs (1 hunks)
  • Explorer/Assets/Scripts/SceneRunner/Tests/SceneFactoryShould.cs (1 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/CommunicationsControllerApi/SDKMessageBus/ISDKMessageBusCommsControllerAPI.cs (1 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/EngineApiWrapper.cs (1 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/Events/SDKObservableEvents.cs (2 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/Events/csc.rsp (1 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/Events/csc.rsp.meta (1 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/ISDKObservableEventsEngineApi.cs (1 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/SDKObservableEventsEngineApiWrapper.cs (3 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/Factory/SceneRuntimeFactory.cs (1 hunks)
  • Explorer/Assets/Scripts/SceneRuntime/SceneRuntimeImpl.cs (2 hunks)
Files skipped from review due to trivial changes (5)
  • Explorer/Assets/DCL/Multiplayer/Connections/Messaging/Hubs/MessagePipesHub.cs
  • Explorer/Assets/DCL/Multiplayer/Connections/Messaging/Pipe/IMessagePipe.cs
  • Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/Events/csc.rsp
  • Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/Events/csc.rsp.meta
Additional comments not posted (70)
Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/CommunicationsControllerApi/SDKMessageBus/ISDKMessageBusCommsControllerAPI.cs (1)

8-8: LGTM!

Changing the return type of SceneCommsMessages from List<CommsPayload> to IReadOnlyList<CommsPayload> is a good practice. It promotes immutability and encapsulation by preventing external modification of the list while still allowing read access.

Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/ISDKObservableEventsEngineApi.cs (6)

8-8: LGTM!

The code changes are approved.


10-10: LGTM!

The code changes are approved.


14-14: LGTM!

The code changes are approved.


16-16: LGTM!

The code changes are approved.


18-18: LGTM!

The code changes are approved.


20-20: LGTM!

The code changes are approved.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/ISceneCommunicationPipe.cs (3)

8-8: LGTM: The interface name change improves code readability.

The new name ISceneCommunicationPipe better reflects the purpose of the interface, which is to handle scene communication. This change enhances code readability and maintainability.


20-20: LGTM: The field name change improves code readability.

The new name FromWalletId provides a clearer context that the wallet ID is the source of the message. This change enhances code readability and reduces ambiguity.


26-26: LGTM!

The code changes are approved.

Explorer/Assets/DCL/Multiplayer/Connections/DCL.Multiplayer.Connections.asmdef (1)

19-22: LGTM!

The code changes are approved. Adding new GUID references to the assembly definition is a valid change.

Explorer/Assets/Scripts/SceneRunner/Scene/ISceneFacade.cs (1)

17-17: LGTM!

The new property SceneData is a good addition to the ISceneFacade interface. It provides a clear and consistent way for implementations of the interface to expose scene-related data, which aligns with the PR objectives.

The property is read-only, which is appropriate for an interface, and the name and type are clear and descriptive. The property is also added at an appropriate location within the interface, maintaining the code structure.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SDKMessageBus/SDKMessageBusCommsAPIImplementation.cs (5)

13-13: LGTM!

The code segment is approved for the following reasons:

  • The field is properly encapsulated by making it private.
  • The readonly modifier ensures that the reference cannot be changed after initialization, which is a good practice.
  • The field is initialized with an empty list, which is also a good practice.

15-15: LGTM!

The code segment is approved for the following reasons:

  • The property provides read-only access to the messages field, which is a good practice for encapsulation.
  • The property is of type IReadOnlyList<CommsPayload>, which is a good choice as it prevents modification of the list from outside the class.

17-17: LGTM!

The code segment is approved for the following reasons:

  • The constructor parameters are of appropriate types and follow the interface segregation principle.
  • The constructor properly calls the base class constructor with the required parameters.

19-21: LGTM!

The code segment is approved for the following reasons:

  • The method provides a way to clear the messages field, which is a useful functionality.
  • The method is properly named and follows the naming convention.

30-39: LGTM!

The code segment is approved for the following reasons:

  • The method properly overrides the base class method with the required parameters.
  • The method correctly handles the received message by checking the messageType and processing only MsgType.String messages.
  • The method properly decodes the decodedMessage using Encoding.UTF8.GetString and adds a new CommsPayload object to the messages field with the correct properties.
Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementation.cs (2)

Line range hint 28-47: LGTM! Verify the method usage in the codebase.

The changes to the OnMessageReceived method look good:

  • The method signature has been simplified by accepting MsgType messageType, ReadOnlySpan<byte> decodedMessage, and string fromWalletId parameters directly.
  • The method now checks the messageType against MsgType.Uint8Array and uses the fromWalletId parameter directly, which enhances clarity and efficiency.

Please verify that the OnMessageReceived method is called correctly from other parts of the codebase.

Run the following script to verify the method usage:

Verification successful

Verification Successful: Method Usage Consistent

The OnMessageReceived method with the new signature is correctly defined and overridden in the codebase. The method is used consistently with the new parameters across the relevant files.

  • CommunicationsControllerAPIImplementationBase.cs: Abstract method definition.
  • SDKMessageBusCommsAPIImplementation.cs: Method overridden with the new signature.
  • CommunicationsControllerAPIImplementation.cs: Method overridden with the new signature.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `OnMessageReceived` method in the codebase.

# Test: Search for the method usage in the codebase. Expect: Only occurrences with the new signature.
rg --type cs -A 5 $'OnMessageReceived\(MsgType messageType, ReadOnlySpan<byte> decodedMessage, string fromWalletId\)'

Length of output: 2639


16-16: LGTM! Verify the interface usage in the codebase.

The change in the constructor parameter type from ICommunicationControllerHub to ISceneCommunicationPipe for the messagePipesHub parameter looks good.

Please verify that the ISceneCommunicationPipe interface is implemented correctly and the rest of the codebase is updated to use the new interface.

Run the following script to verify the interface usage:

Verification successful

Interface Usage Verified: Refactoring Complete

The ISceneCommunicationPipe interface is correctly implemented and used in the codebase. The transition from ICommunicationControllerHub to ISceneCommunicationPipe has been successfully completed.

  • ISceneCommunicationPipe is declared in Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/ISceneCommunicationPipe.cs.
  • Implemented by SceneCommunicationPipe in Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SceneCommunicationPipe.cs.
  • The old interface ICommunicationControllerHub is no longer present in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `ISceneCommunicationPipe` interface in the codebase.

# Test 1: Search for the interface declaration. Expect: Only one occurrence.
rg --type cs -c $'interface ISceneCommunicationPipe'

# Test 2: Search for classes implementing the interface. Expect: At least one implementation.
rg --type cs -A 5 $'class \w+ : ISceneCommunicationPipe'

# Test 3: Search for the interface usage in the codebase. Expect: No occurrences of the old interface.
rg --type cs -c $'ICommunicationControllerHub'

Length of output: 2212

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SceneCommunicationPipe.cs (6)

16-16: LGTM!

The class name change from CommunicationControllerHub to SceneCommunicationPipe and the interface change from ICommunicationControllerHub to ISceneCommunicationPipe are consistent and reflect a shift in the class's role within the architecture, likely enhancing clarity regarding its purpose in scene communication.


18-18: LGTM!

The private field onSceneMessage type change from Action<ICommunicationControllerHub.SceneMessage>? to Action<ISceneCommunicationPipe.SceneMessage>? is consistent with the class's interface change and ensures that the message handling logic is coherent with the new class structure.


21-21: LGTM!

The constructor change is consistent with the class name change from CommunicationControllerHub to SceneCommunicationPipe and maintains its dependency on IMessagePipesHub.


33-33: LGTM!

The method RemoveSceneMessageHandler parameter type change from Action<ICommunicationControllerHub.SceneMessage> to Action<ISceneCommunicationPipe.SceneMessage> is consistent with the class's interface change and reinforces the class's focus on scene-related messages.


38-38: LGTM!

The method SetSceneMessageHandler parameter type change from Action<ICommunicationControllerHub.SceneMessage> to Action<ISceneCommunicationPipe.SceneMessage> is consistent with the class's interface change and reinforces the class's focus on scene-related messages.


30-30: LGTM!

The method InvokeCurrentHandler change to invoke the updated onSceneMessage with the new message type ISceneCommunicationPipe.SceneMessage is consistent with the class's interface change and ensures that the message handling logic is coherent with the new class structure.

Explorer/Assets/Scripts/SceneRunner/EmptyScene/EmptySceneFacade.cs (1)

29-29: LGTM!

The addition of the read-only SceneData property is a good enhancement to the EmptySceneFacade class. It provides access to scene data while preventing unintended modifications. The property is initialized with a reasonable default value, and the change introduces new capabilities for managing scene-related information without affecting the overall control flow.

Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/EngineApiWrapper.cs (1)

73-73: Verify the impact of the nullable return type on the derived classes and the consumers.

The change looks good as it introduces nullability to the return type and provides a consistent default implementation.

However, please ensure that:

  • The derived classes that override this method return the correct type.
  • The consumers of this method handle the potential null return value appropriately.

Run the following script to verify the impact:

Verification successful

Nullable return type is handled correctly in the derived class and its usage.

The SendBatch method's nullable return type is consistently used in the SDKObservableEventsEngineApiWrapper class, and the potential null return value is appropriately handled with a null check. No other usages were found that might be affected by this change.

  • The overridden method in SDKObservableEventsEngineApiWrapper uses the nullable return type.
  • The method usage includes a null check to handle the potential null return value.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the nullable return type of `SendBatch` method.

# Test 1: Search for the overrides of the method. Expect: Consistent return type.
ast-grep --lang csharp --pattern $'class $_ : EngineApiWrapper {
  $$$
  public override ScriptableSDKObservableEventArray? SendBatch() {
    $$$
  }
  $$$
}'

# Test 2: Search for the usages of the method. Expect: Null checks before accessing the return value.
rg --type csharp -A 5 $'SendBatch\(\)'

Length of output: 2196

Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/SDKObservableEventsEngineApiWrapper.cs (8)

26-26: LGTM!

The code change is an improvement as it uses a more semantic method name to check for subscriptions.


28-28: LGTM!

The code change is an improvement as it uses a more semantic method name to clear the events.


29-29: LGTM!

The code change is an improvement as it uses a more semantic method name to clear the messages.


52-52: LGTM!

The code change is an improvement as it uses a more semantic method name to check for the subscription.


58-58: LGTM!

The code change is an improvement as it uses a more semantic method name to create the event.


60-60: LGTM!

The code change is an improvement as it uses a more semantic method name to clear the messages.


66-66: LGTM!

The code change is an improvement as it uses a more semantic method name to add the subscription.


72-72: LGTM!

The code change is an improvement as it uses a more semantic method name to remove the subscription.

Explorer/Assets/Scripts/SceneRuntime/Apis/Modules/EngineApi/SDKObservableEvents/Events/SDKObservableEvents.cs (2)

26-26: LGTM!

The code changes are approved.


39-40: LGTM!

The code changes are approved.

Explorer/Assets/Scripts/Global/SceneSharedContainer.cs (1)

69-69: The change is consistent with the interface renaming and may impact message handling.

The change replaces the creation of a CommunicationControllerHub object with a SceneCommunicationPipe object, which is consistent with the interface renaming from ICommunicationControllerHub to ISceneCommunicationPipe mentioned in the list of alterations.

As explained in the AI-generated summary, this change suggests a shift in the underlying communication mechanism utilized by the SceneSharedContainer, potentially impacting how messages are handled or routed within the scene.

The change is localized and does not introduce any apparent issues.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs (7)

13-13: Good design decision to make the class abstract.

Making the CommunicationsControllerAPIImplementationBase class abstract enforces it to be subclassed and prevents it from being instantiated directly. This aligns well with the class's purpose of serving as a base for communication controller implementations.


15-15: Changing MsgType enum to public improves usability.

Making the MsgType enum public allows it to be accessed from outside the assembly. This change enhances the usability of the message types across different components that interact with the communications API.


22-28: Field changes improve encapsulation and clarity.

The changes in the fields are beneficial for the following reasons:

  • Changing cancellationTokenSource to private encapsulates its usage within the class, which is a good practice.
  • The removal of messagePipesHub and introduction of sceneCommunicationPipe align with the constructor's changes and the new communication structure.
  • The new fields sceneData, sceneStateProvider, jsOperations, and onMessageReceivedCached provide necessary dependencies and improve the clarity of the class.

55-57: Consistent usage of the new communication structure.

Updating the OnSceneIsCurrentChanged method to utilize the new sceneCommunicationPipe for setting and removing message handlers ensures that the new communication structure is consistently applied throughout the class. The changes align well with the overall refactoring of the communication mechanism.


66-67: Good practice to avoid sending empty messages.

Checking if the poolable length is greater than 0 before sending the message is a good practice to avoid unnecessary processing of empty messages. The code segment is small and focused, making it easy to understand and maintain.


86-91: Refactoring improves flexibility and maintainability.

The refactoring of SendMessage into EncodeAndSendMessage with a MsgType parameter improves the flexibility of message encoding based on the type. Making the method protected aligns with the abstract nature of the class and its intended usage by subclasses. Streamlining the encoding logic enhances the clarity and maintainability of the code.


101-112: New methods improve message handling and promote separation of responsibilities.

The introduction of the private OnMessageReceived method enhances the class's ability to handle different message formats and improves the clarity of the message processing logic. The method effectively decouples the message decoding logic from the actual message handling, which is delegated to the subclasses through the abstract OnMessageReceived method.

Declaring the abstract OnMessageReceived method enforces subclasses to provide their own implementation for handling received messages, promoting a clear separation of responsibilities. This design choice aligns well with the abstract nature of the class and encourages a modular and extensible architecture.

Explorer/Assets/Scripts/SceneRunner/Tests/SceneFactoryShould.cs (1)

69-69: LGTM!

The code change aligns the test setup with the refactored communication interface ISceneCommunicationPipe, which seems to be a more appropriate substitute for the test context. This change is consistent with the overall refactoring effort to improve the separation of concerns and clarity in the codebase.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs (7)

25-25: LGTM!

The change is consistent with the refactoring effort to replace the communication hub with a communication pipe.


33-33: LGTM!

The change is consistent with the refactoring effort to replace the communication hub with a communication pipe.


42-42: LGTM!

The change is consistent with the refactoring effort to replace the communication hub with a communication pipe.


61-61: LGTM!

The change is consistent with the refactoring effort to replace the communication hub with a communication pipe.


76-76: LGTM!

The change is consistent with the refactoring effort to replace the communication hub with a communication pipe.


104-104: LGTM!

The change is consistent with the refactoring effort to replace the communication hub with a communication pipe.


107-107: LGTM!

The changes are consistent with the refactoring effort to replace the communication hub with a communication pipe.

Also applies to: 109-111, 114-116

Explorer/Assets/Scripts/SceneRuntime/SceneRuntimeImpl.cs (1)

Line range hint 32-43: Refactoring to simplify the constructor and reduce dependencies.

The removal of the IInstancePoolsProvider and V8EngineFactory dependencies from the constructor is a significant refactoring effort to simplify the class's responsibilities and reduce coupling. This change suggests that the class no longer directly manages instance pools or the engine factory.

Please verify if the removed dependencies are still required and handled appropriately elsewhere in the codebase. Run the following script to search for usages of IInstancePoolsProvider and V8EngineFactory:

Verification successful

Refactoring confirmed: Dependencies are managed elsewhere.

The removal of IInstancePoolsProvider and V8EngineFactory from SceneRuntimeImpl is part of a refactoring effort to simplify the class and reduce coupling. These dependencies are still actively used and managed in other parts of the codebase, indicating a shift in design to delegate responsibilities to more appropriate components.

  • IInstancePoolsProvider is used in various components, including CrdtEcsBridge and SceneRuntime.
  • V8EngineFactory is utilized in SceneRuntimeFactory and related tests.

This refactoring aligns with best practices for modularity and separation of concerns.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for usages of `IInstancePoolsProvider` and `V8EngineFactory` in the codebase.

# Test 1: Search for `IInstancePoolsProvider` usage. Expect: No results or usage in appropriate components.
rg --type cs $'IInstancePoolsProvider'

# Test 2: Search for `V8EngineFactory` usage. Expect: No results or usage in appropriate components.
rg --type cs $'V8EngineFactory'

Length of output: 8607

Explorer/Assets/Scripts/SceneRunner/SceneFactory.cs (2)

53-53: LGTM!

The change in the field type from ICommunicationControllerHub to ISceneCommunicationPipe improves clarity and suggests a more specialized interface for scene-related communication.


73-73: LGTM!

The constructor parameter type change for messagePipesHub from ICommunicationControllerHub to ISceneCommunicationPipe aligns with the updated field type, ensuring consistency.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/SDKObservableEventsEngineAPIImplementation.cs (10)

23-24: LGTM!

The code changes are approved.


25-25: LGTM!

The code changes are approved.


35-44: LGTM!

The code changes are approved.


47-53: LGTM!

The code changes are approved.


55-59: LGTM!

The code changes are approved.


61-64: LGTM!

The code changes are approved.


66-69: LGTM!

The code changes are approved.


84-91: LGTM!

The code changes are approved.


105-105: LGTM!

The code changes are approved.


Line range hint 120-227: LGTM!

The code changes are approved.

Explorer/Assets/Scripts/SceneRunner/SceneInstanceDeps.cs (3)

229-229: LGTM!

The change in the interface name from ICommunicationControllerHub to ISceneCommunicationPipe for the parameter messagePipesHub is consistent with the PR objective of renaming the interface for better clarity.


254-254: LGTM!

The change in the constructor parameter type from ICommunicationControllerHub to ISceneCommunicationPipe for messagePipesHub is consistent with the change made in the base class constructor. This ensures that the new interface is used consistently across the class hierarchy.


273-273: LGTM!

The change in the constructor parameter type from ICommunicationControllerHub to ISceneCommunicationPipe for messagePipesHub is consistent with the change made in the base class constructor. This ensures that the new interface is used consistently across the class hierarchy.

Explorer/Assets/Scripts/SceneRunner/Tests/SceneFacadeShould.cs (1)

109-109: LGTM!

The change is consistent with the list of alterations. The new interface name ISceneCommunicationPipe provides better context about its purpose compared to the old name.

Copy link
Collaborator

@mikhail-dcl mikhail-dcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another small refactoring should be done #1991

But for now, as this refactoring was produced as a side product of other fixes, we can approve it and merge

Copy link
Contributor

@anicalbano anicalbano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Reviewed by QA

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between be1b682 and 914d14c.

Files selected for processing (6)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementation.cs (3 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs (4 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SDKMessageBus/SDKMessageBusCommsAPIImplementation.cs (1 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs (5 hunks)
  • Explorer/Assets/Scripts/SceneRunner/SceneFactory.cs (2 hunks)
  • Explorer/Assets/Scripts/SceneRunner/SceneInstanceDeps.cs (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SDKMessageBus/SDKMessageBusCommsAPIImplementation.cs
  • Explorer/Assets/Scripts/SceneRunner/SceneFactory.cs
Additional context used
Path-based instructions (4)
Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementation.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/Scripts/SceneRunner/SceneInstanceDeps.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Additional comments not posted (13)
Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementation.cs (2)

32-32: Refactored OnMessageReceived method.

The method now directly accepts message type and content parameters, which simplifies the handling process and improves performance. Verify that all derived classes correctly implement the new method signature.

Run the following script to verify the method's implementation across derived classes:

Also applies to: 34-34, 38-40

Verification successful

Verified: Consistent implementation of OnMessageReceived method.

The OnMessageReceived method with the new signature is correctly implemented in the relevant derived classes. The abstract method in CommunicationsControllerAPIImplementationBase.cs ensures compliance across implementations. Other instances of OnMessageReceived in the codebase are unrelated to this change.

  • CommunicationsControllerAPIImplementationBase.cs: Abstract method definition.
  • SDKMessageBusCommsAPIImplementation.cs: Correct override.
  • CommunicationsControllerAPIImplementation.cs: Correct override.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new method signature is implemented correctly in all derived classes.

# Test: Search for the method signature in derived classes. Expect: Correct implementation.
rg --type cs "OnMessageReceived"

Length of output: 4123


19-19: Constructor parameter type updated.

The change from ICommunicationControllerHub to ISceneCommunicationPipe is aligned with the PR's objectives to streamline communication handling. Ensure all instances where the old interface was used are updated to the new interface.

Run the following script to verify the interface usage:

Verification successful

Transition to ISceneCommunicationPipe is complete and consistent.

The codebase has been thoroughly updated to use ISceneCommunicationPipe instead of ICommunicationControllerHub. This change is reflected across multiple files, including implementations and tests, ensuring a consistent and comprehensive integration.

  • ISceneCommunicationPipe is implemented in SceneCommunicationPipe.
  • It is used in various constructors and methods across the codebase.
  • Test files reference ISceneCommunicationPipe, indicating that the new interface is being tested.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to `ICommunicationControllerHub` have been updated.

# Test: Search for the old interface usage. Expect: No occurrences.
rg --type cs "ICommunicationControllerHub"

Length of output: 42


Script:

#!/bin/bash
# Description: Verify the usage of the new interface `ISceneCommunicationPipe`.

# Search for the new interface usage to ensure it is implemented and used correctly.
rg --type cs "ISceneCommunicationPipe" -A 5

Length of output: 18048

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs (3)

65-65: Updated assertions in SendBinary test method.

The assertions now correctly reference sceneCommunicationPipe.sendMessageCalls, ensuring they are aligned with the updated communication handling architecture. Verify that the new assertions correctly check the expected outcomes.

Run the following script to verify the correctness of the new assertions:

Verification successful

Verification of assertion change in SendBinary test method.

The assertion now correctly references sceneCommunicationPipe.sendMessageCalls, aligning with the updated communication handling architecture. Ensure that expectedCalls is correctly defined and populated in the test setup to verify the correctness of the new assertions.

  • File: Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs
  • Line: 65
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new assertions check the expected outcomes.

# Test: Search for the assertion usage in the test suite. Expect: Correct implementation.
rg --type cs "CollectionAssert.AreEqual"

Length of output: 3199


26-26: Updated test setup to use TestSceneCommunicationPipe.

The test setup now correctly initializes and uses the new TestSceneCommunicationPipe, aligning with the updated communication handling architecture. Verify that the new test component is correctly initialized and used throughout the test suite.

Run the following script to verify the test component's initialization and usage:

Also applies to: 34-34, 46-46

Verification successful

Test component TestSceneCommunicationPipe is correctly initialized and used.

The TestSceneCommunicationPipe is properly initialized and actively used in the test suite, confirming its integration into the test logic. The component is involved in assertions and method invocations, ensuring that the tests align with the updated communication handling architecture.

  • Initialization: sceneCommunicationPipe = new TestSceneCommunicationPipe();
  • Usage: Involved in assertions and method calls within the test methods.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new test component is correctly initialized and used.

# Test: Search for the test component usage in the test suite. Expect: Correct initialization and usage.
rg --type cs "TestSceneCommunicationPipe"

Length of output: 608


Script:

#!/bin/bash
# Description: Verify the usage of the test component within the test file.

# Test: Search for method calls or interactions involving `sceneCommunicationPipe`.
rg --type cs "sceneCommunicationPipe" -A 3

Length of output: 8239


80-80: Updated event invocation in OnMessageReceived test method.

The event invocation now correctly uses sceneCommunicationPipe.onSceneMessage.Invoke, ensuring it is aligned with the updated communication handling architecture. Verify that the new event invocation is correctly implemented.

Run the following script to verify the correctness of the new event invocation:

Verification successful

Event invocation correctly implemented and verified in test setup.

The sceneCommunicationPipe and onSceneMessage are correctly initialized and used in the test setup. The event invocation is aligned with the updated communication handling architecture and is verified through the test. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new event invocation is correctly implemented.

# Test: Search for the event invocation usage in the test suite. Expect: Correct implementation.
rg --type cs "onSceneMessage.Invoke"

Length of output: 276


Script:

#!/bin/bash
# Description: Check the initialization and usage of `sceneCommunicationPipe` and `onSceneMessage` in the test setup.

# Search for the initialization of `sceneCommunicationPipe` in the test file.
rg --type cs "sceneCommunicationPipe" -A 5

# Search for the setup or initialization of `onSceneMessage` in the test file.
rg --type cs "onSceneMessage" -A 5

Length of output: 19120

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs (5)

16-16: Class declaration updated to abstract.

The change to declare CommunicationsControllerAPIImplementationBase as abstract enforces a structured inheritance model and prevents direct instantiation. Verify that all derived classes correctly extend this abstract class.

Run the following script to verify the class's usage in derived classes:

Verification successful

Derived classes correctly extend the abstract class.

The classes CommunicationsControllerAPIImplementation and SDKMessageBusCommsAPIImplementation correctly extend the CommunicationsControllerAPIImplementationBase abstract class, ensuring the intended inheritance model is followed. No issues found with the class hierarchy.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the abstract class is correctly extended in all derived classes.

# Test: Search for the class usage in derived classes. Expect: Correct extension.
rg --type cs "CommunicationsControllerAPIImplementationBase"

Length of output: 1504


108-108: Refactored SendMessage into EncodeAndSendMessage.

The method now allows for more flexible message encoding based on the type and enhances clarity in message handling. Verify that EncodeAndSendMessage is correctly implemented and used by subclasses.

Run the following script to verify the method's implementation and usage:

Also applies to: 110-113

Verification successful

Verified: EncodeAndSendMessage is correctly implemented and used by subclasses.

The method is utilized in SDKMessageBusCommsAPIImplementation.cs, confirming its intended use for flexible message encoding and sending. No further issues found.

  • CommunicationsControllerAPIImplementationBase.cs: Method definition and usage.
  • SDKMessageBusCommsAPIImplementation.cs: Subclass usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new method is correctly implemented and used by subclasses.

# Test: Search for the method's usage in subclasses. Expect: Correct implementation and usage.
rg --type cs "EncodeAndSendMessage"

Length of output: 651


25-25: Field visibility and type updated.

The changes to the fields, including the modification of cancellationTokenSource to private and the introduction of sceneCommunicationPipe, enhance encapsulation and align with the architectural adjustments. Verify that the new fields are correctly used within the class and do not introduce any regressions.

Run the following script to verify the fields' usage within the class:

Also applies to: 26-26, 44-44

Verification successful

Field usage verified and encapsulation appropriate.

The cancellationTokenSource and sceneCommunicationPipe fields in CommunicationsControllerAPIImplementationBase.cs are used correctly within the class. The changes enhance encapsulation and align with the intended functionality without introducing regressions.

  • cancellationTokenSource is used for managing asynchronous operations safely.
  • sceneCommunicationPipe is used for handling scene communication effectively.

No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new fields are correctly used within the class.

# Test: Search for the fields' usage within the class. Expect: Correct usage.
rg --type cs "cancellationTokenSource|sceneCommunicationPipe"

Length of output: 26205


123-123: Introduced new OnMessageReceived method.

The new method processes incoming messages based on their type, enhancing the class's message handling capabilities. Verify that OnMessageReceived is correctly implemented and used by subclasses.

Run the following script to verify the method's implementation and usage:

Also applies to: 125-132

Verification successful

Verification successful for OnMessageReceived method.

The OnMessageReceived method is correctly implemented and used by subclasses, enhancing the class's message handling capabilities as intended. No issues were found regarding its implementation or usage.

  • CommunicationsControllerAPIImplementation.cs: Overrides OnMessageReceived.
  • SDKMessageBusCommsAPIImplementation.cs: Overrides OnMessageReceived.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new method is correctly implemented and used by subclasses.

# Test: Search for the method's usage in subclasses. Expect: Correct implementation and usage.
rg --type cs "OnMessageReceived"

Length of output: 4123


69-69: Updated OnSceneIsCurrentChanged method to use sceneCommunicationPipe.

The method now correctly utilizes the new sceneCommunicationPipe for setting and removing message handlers, aligning with the updated communication handling architecture. Verify that the method is correctly implemented and does not introduce any regressions.

Run the following script to verify the method's implementation:

Also applies to: 71-71

Verification successful

Verified Implementation of OnSceneIsCurrentChanged Method

The OnSceneIsCurrentChanged method in CommunicationsControllerAPIImplementationBase.cs is correctly implemented. It appropriately manages the setting and removal of scene message handlers based on the isCurrent flag, ensuring alignment with the updated communication handling architecture. No regressions are introduced by this change.

  • The method checks IgnoreIsCurrentScene() and exits early if true.
  • It sets or removes the scene message handler using sceneCommunicationPipe based on the isCurrent flag.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the method is correctly implemented.

# Test: Search for the method's implementation. Expect: Correct implementation.
rg --type cs "OnSceneIsCurrentChanged"

Length of output: 3666


Script:

#!/bin/bash
# Extract the implementation of OnSceneIsCurrentChanged in CommunicationsControllerAPIImplementationBase.cs
ast-grep --lang c_sharp --pattern $'class CommunicationsControllerAPIImplementationBase {
  $$$
  public void OnSceneIsCurrentChanged(bool isCurrent) {
    $$$
  }
  $$$
}'

Length of output: 288


Script:

#!/bin/bash
# Use rg to extract the implementation of OnSceneIsCurrentChanged in CommunicationsControllerAPIImplementationBase.cs
rg --type cs -A 10 "public void OnSceneIsCurrentChanged" --word-regexp

Length of output: 11134

Explorer/Assets/Scripts/SceneRunner/SceneInstanceDeps.cs (3)

254-254: Verify the implementation and usage of ISceneCommunicationPipe in this context.

The constructor now uses ISceneCommunicationPipe. Ensure that the implementation and usage of this new interface are correct and that it integrates well with existing systems in this specific context.

Verification successful

Implementation and Usage of ISceneCommunicationPipe Verified

The ISceneCommunicationPipe interface is correctly implemented and integrated within the codebase. It is used appropriately in the constructor of SceneInstanceDeps.cs, and its functionality is supported by both production code and unit tests.

  • The interface is implemented in SceneCommunicationPipe.cs.
  • It is used in various classes, including SceneFactory.cs and SceneInstanceDeps.cs.
  • Unit tests effectively mock the interface to ensure its functionality.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation and usage of `ISceneCommunicationPipe` in the context of `WithRuntimeAndJsAPI`.

# Test: Search for the interface implementation and usage. Expect: Correct implementation and usage patterns.
rg --type cs -A 5 $'ISceneCommunicationPipe'

Length of output: 18048


229-229: Verify the implementation and usage of ISceneCommunicationPipe.

The constructor now uses ISceneCommunicationPipe instead of ICommunicationControllerHub. Ensure that the implementation and usage of this new interface are correct and that it integrates well with existing systems.

Verification successful

Verified: Correct implementation and usage of ISceneCommunicationPipe.

The ISceneCommunicationPipe interface is properly defined and implemented by the SceneCommunicationPipe class. It is used consistently across the codebase, and its functionality is covered by tests, ensuring correct integration and usage.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation and usage of `ISceneCommunicationPipe`.

# Test: Search for the interface implementation and usage. Expect: Correct implementation and usage patterns.
rg --type cs -A 5 $'ISceneCommunicationPipe'

Length of output: 18048


273-273: Verify the implementation and usage of ISceneCommunicationPipe in this context.

The constructor now uses ISceneCommunicationPipe. Ensure that the implementation and usage of this new interface are correct and that it integrates well with existing systems in this specific context.

Verification successful

Implementation and Usage of ISceneCommunicationPipe Verified

The ISceneCommunicationPipe interface is correctly implemented and integrated within the codebase, including the WithRuntimeJsAndSDKObservablesEngineAPI constructor. The presence of concrete implementations and test cases further supports its proper usage. No issues were found regarding its integration.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation and usage of `ISceneCommunicationPipe` in the context of `WithRuntimeJsAndSDKObservablesEngineAPI`.

# Test: Search for the interface implementation and usage. Expect: Correct implementation and usage patterns.
rg --type cs -A 5 $'ISceneCommunicationPipe'

Length of output: 18048

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 914d14c and 78a4315.

Files selected for processing (3)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs (5 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SDKMessageBus/SDKMessageBusCommsAPIImplementation.cs (1 hunks)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs (5 hunks)
Files not reviewed due to server errors (3)
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SDKMessageBus/SDKMessageBusCommsAPIImplementation.cs
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs
  • Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs
Additional context used
Path-based instructions (3)
Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SDKMessageBus/SDKMessageBusCommsAPIImplementation.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs (2)

Pattern **/*.cs: Review the code for heap allocations and suggest potential improvements to avoid runtime allocations.


Pattern **/*.cs: Review the code for specific unity engine optimizations and suggest potential improvements.

@NickKhalow NickKhalow enabled auto-merge (squash) September 9, 2024 13:38
@NickKhalow NickKhalow force-pushed the fix/initial-state-sync branch from 78a4315 to be1b682 Compare September 9, 2024 14:54
# Conflicts:
#	Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementation.cs
#	Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/CommunicationsControllerAPIImplementationBase.cs
#	Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Communications/SDKMessageBus/SDKMessageBusCommsAPIImplementation.cs
#	Explorer/Assets/Scripts/CrdtEcsBridge/JsModulesImplementation/Tests/CommunicationControllerAPIImplementationShould.cs
#	Explorer/Assets/Scripts/SceneRunner/SceneFactory.cs
@NickKhalow NickKhalow merged commit ea3c2bf into main Sep 9, 2024
4 of 5 checks passed
@NickKhalow NickKhalow deleted the fix/initial-state-sync branch September 9, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initial State of Scene is not synchronised when leaving/entering the scene
3 participants