Skip to content

Conversation

@MAG-AdamThorn
Copy link
Contributor

The current DuplicateSpace method is a synchronous operation that can timeout and fail if the Space is overly complex or the backend services are under excessive load.

A new generic AsyncCallCompleted event has been added by the backend services to alert the user when a specific async operation has completed. Operations such as DuplicateSpace can take a AsyncCall bool argument, which determines whether the operation should be performed synchronously or asynchronously.
If performed asynchronously the call will immediately return a result object, which in the case of Duplicate Space will contain a 204 - No content response on success. Then, once the actual duplication operation has been completed, the AsyncCallCompleted event will fire, passing a AsyncCallCompletedEventData object.

As part of this work the current DuplicateSpace method has been marked deprecated and a new DuplicateSpaceAsync method has been introduced. This approach has been taken for two reasons:

  1. CHS intend to remove the synchronous flow.
  2. The async flow returns a different result object - SpaceResult vs NullResult.

A new AsyncCallCompletedCallbackHandler has been introduced along with a public setter to allow clients to register for the AsyncCallCompleted event: SetAsyncCallCompletedCallback().

As noted above, this event will return a generic 'AsyncCallCompletedEventData` object, which in the case of the duplicate Space operation, will contain the following data:

  • OperationName: "DuplicateSpaceAsync"
  • ReferenceId: "Id of the new Space"
  • ReferenceType: "GroupId"

@github-actions
Copy link

🚀 Pull Request Review Guidelines

Thank you for taking the time to review this Pull Request. The following is a summary of our Pull Request guidelines. The full guidelines can be found here.

💬 How to Provide Feedback

We use a comment ladder when leaving review comments to avoid any ambiguity.

Tag Is response required? Is a change required? May the PR author resolve?
[Fix] ✔️ ✔️
[Consider] ✔️ ✔️
[Question] ✔️
[Nit] ✔️
[Comment] ✔️

All comments should be prefixed with one of the above tags, for example:
[fix] Your editor is still set to use tabs instead of spaces, or this file is old and needs to be reformatted.

⚠️ Reviewers should be sure to resolve conversations if they feel their feedback has been addressed sufficiently.

🎯 PR Author Focus Areas

  • Link Commits to Conversations After making a change in response to a reviewer's comment, link the specific commit in the comment thread. This will allow the reviewer to view the change without having to hunt the codebase for it.
  • Breaking Changes Any breaking changes made to the public interface must be specifically called out in the PR. The preferred format is a bullet list enumerating the specific nature of the change/s, as well as the types and method signatures that are affected. If necessary, migration guidance should also be provided here.

Thanks again for taking the time to review this Pull Request.

@MAG-AdamThorn MAG-AdamThorn marked this pull request as ready for review October 28, 2025 14:12
@MAG-AdamThorn MAG-AdamThorn requested a review from a team as a code owner October 28, 2025 14:12
- Update the error message logged when the 'AsyncCallCompletedCallback' is not set successfully.
- Correct a typo comment in the 'AsyncCallCompletedEventData' class.
The SpaceSystem was being passed to the NetworkEventBus ctor by ptr and then we had a nullptr check to ensure it was valid before attempting to add an event listener. However, the NetworkEventBus cannot be null and should therefore be passed by ref.
The MultiplayerConnection::GetEventBus() method has been updated to return a reference to the EventBus. This ref is then passed to the systems, which dereference it before passing it to the SystemBase class. This is similar to what is done with the LogSystem.

I also took the opportunity to remove any 'In' prefixes from related method arguments.
[OF-1736] fix: Update
- Added more detailed comments to the DuplicateSpaceAsync() method to enumerate the operation data that would be returned via the AsyncCallCompletedCallback.
- Updated the comments for the OnAsyncCallCompletedEvent() method to match.
-Updated the DuplicateSpaceAsyncTest promise to capture the NetworkEventData rather than asserting equality within the lambda.
- Added a 30 second timeout to the future wait to account for the async operation timing out due to backed service load.
- Updated the EXPECT_* to be ASSERT_*.
@MAG-AdamThorn MAG-AdamThorn force-pushed the OF-1736_Expose_AsyncCall_field_to_DuplicateSpace_call branch from 10ba011 to e6d8ab2 Compare October 30, 2025 10:28
… dtor

Previously individual systems were responsible for deregistering their system callbacks with the NetworkEventBus on destruction.
However, the NetworkEventBus (which is owned by the MultiplayerConnection) is one of the last systems to be cleaned up by the SystemsManager, so it made sense to move this logic to the NetworkEventBus dtor.
@MAG-AdamThorn MAG-AdamThorn requested a review from MAG-mv October 30, 2025 15:06
Updated docs for the DuplicateSpace and DuplicateSpaceAsync methods to outline behaviour if the user disconnects while the operation is being carried out.
- Inject UserSystem into the SpaceSystem via it's ctor so that it can be used without having to rely on the singleton.
- Adopt the Convert utility for creating a vector of MemberGroupIds from the provided Optional Array.
Updated the SystemsManager::GetEventBus() method to return a ptr to the EventBus. I had updated it to return a ref forgetting that the wrapper generator does not support that.
@MAG-AdamThorn MAG-AdamThorn merged commit 308d296 into main Oct 31, 2025
9 checks passed
@MAG-AdamThorn MAG-AdamThorn deleted the OF-1736_Expose_AsyncCall_field_to_DuplicateSpace_call branch October 31, 2025 17:57
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.

5 participants