Skip to content

Conversation

@KubaZ2
Copy link
Member

@KubaZ2 KubaZ2 commented Oct 29, 2025

No description provided.

@KubaZ2 KubaZ2 requested a review from Copilot October 29, 2025 19:55
@github-actions
Copy link

The documentation preview is available at https://preview.netcord.dev/206.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Build() methods in builder classes to use thread-safe operations and centralizes service manager creation logic. The changes improve thread safety by using Interlocked.Exchange() to atomically swap and clear builder collections.

  • Replaced manual read-then-clear pattern with atomic Interlocked.Exchange() in all builder Build() methods
  • Added centralized CreateServiceManager method to eliminate code duplication in ApplicationCommandServiceServiceCollectionExtensions
  • Added missing using directive for Microsoft.Extensions.DependencyInjection.Extensions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
IComponentInteractionsBuilder.cs Updated Build() to use Interlocked.Exchange() for thread-safe builder collection clearing
ICommandsBuilder.cs Updated Build() to use Interlocked.Exchange() for thread-safe data clearing
IApplicationCommandsBuilder.cs Updated Build() to use Interlocked.Exchange() for thread-safe builder collection clearing
ApplicationCommandServiceServiceCollectionExtensions.cs Added CreateServiceManager method to centralize service manager creation and reduce duplication; added missing using directive

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KubaZ2 KubaZ2 merged commit 8b47768 into alpha Oct 29, 2025
7 checks passed
@KubaZ2 KubaZ2 deleted the feature/hosting-app-command-service-manager branch October 29, 2025 20:04
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