Skip to content

Conversation

Copy link

Copilot AI commented Dec 29, 2025

Improved code quality in the Turbo.Rooms project by removing anti-patterns and applying Orleans/async best practices.

Changes

  • Removed useless try-catch blocks that only rethrow exceptions (RoomService.cs, RoomGrain.cs)
  • Simplified furniture method wrappers - removed redundant exception handling that swallowed errors and returned false
  • Fixed logging - replaced Console.WriteLine with ILogger in ApplyWiredUpdateAsync
  • Added ConfigureAwait(false) to async calls in grain methods per Orleans guidance
  • Removed empty switch blocks in WiredContext.cs

Example

Before:

public async Task<bool> PlaceFloorItemAsync(...)
{
    try
    {
        if (!await _actionModule.PlaceFloorItemAsync(...))
            return false;
        return true;
    }
    catch
    {
        // TODO handle exceptions
        return false;
    }
}

After:

public async Task<bool> PlaceFloorItemAsync(...)
{
    return await _actionModule.PlaceFloorItemAsync(...).ConfigureAwait(false);
}

Net: -168 lines of redundant code

Original prompt

Take a look at the Turbo.Rooms project and see what you can do to improve it. I'm using dotnet & Orleans.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 29, 2025 19:51
Co-authored-by: billsonnn <1469194+billsonnn@users.noreply.github.com>
Co-authored-by: billsonnn <1469194+billsonnn@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve performance of Turbo.Rooms project Clean up exception handling and async patterns in Turbo.Rooms Dec 29, 2025
Copilot AI requested a review from billsonnn December 29, 2025 19: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.

2 participants