Skip to content

Conversation

@adalon
Copy link
Collaborator

@adalon adalon commented Jun 5, 2025

No description provided.

@kzu
Copy link
Member

kzu commented Jun 5, 2025

32 passed 32 passed 7 skipped

🧪 Details on Ubuntu 24.04.2 LTS

from dotnet-retest v0.7.1 on .NET 8.0.16 with 💜 by @devlooped

@adalon adalon force-pushed the dev/adalon/ConversationTable branch 9 times, most recently from dda6521 to fbe8ac2 Compare June 6, 2025 16:02
@adalon adalon force-pushed the dev/adalon/ConversationTable branch from fbe8ac2 to 78b0d4b Compare June 6, 2025 16:09
@adalon adalon marked this pull request as ready for review June 6, 2025 16:09
@adalon adalon requested review from Copilot and kzu June 6, 2025 16:09
Copy link

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 integrates feature flags for storage and conversation, extends AddWhatsApp to accept IConfiguration, and refactors storage and conversation services to support per-message and conversation-level persistence.

  • Add Microsoft.FeatureManagement and register feature filters in DI.
  • Extend all AddWhatsApp overloads to take an IConfiguration and wire up feature management.
  • Refactor StorageService/IStorageService and handlers to support conversation storage, active conversation retrieval, and gate by flags.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
WhatsAppServiceCollectionExtensions.cs Added IConfiguration parameter to AddWhatsApp, wired up AddFeatures.
WhatsApp.csproj Added Microsoft.FeatureManagement package reference.
StorageService.cs Inject IFeatureManager, implement conversation and active‐conversation save and query.
StorageHandlerExtensions.cs Updated UseStorage to pass IFeatureManager to StorageService.
MessageStorageHandler.cs Replace bulk save with per‐message save calls to leverage new overload.
IStorageService.cs Remove bulk‐save signature; add new streaming and active‐conversation methods.
FeatureFlags.cs Introduce FeatureFlags enum and extension to simplify IsEnabledAsync.
FeatureFilter.cs Implement feature‐filter based on DI service presence; register via AddFeatures.
ConversationService.cs Switch to new streaming methods, use active conversation cache.
ConversationHandlerExtensions.cs Guard against duplicate ConversationService registration.
Conversation.cs Add immutable Conversation record.
SampleApp/Sample/Program.cs Update sample to pass builder.Configuration into AddWhatsApp call.
Comments suppressed due to low confidence (4)

src/WhatsApp/IStorageService.cs:60

  • The summary for GetActiveConversationAsync says it retrieves the active conversation ID but returns a full Conversation. Update the summary to reflect that it returns the active Conversation object.
/// <summary>

src/WhatsApp/ConversationService.cs:5

  • [nitpick] The constructor parameter storage is ambiguous—renaming it to storageService would more clearly convey its purpose.
class ConversationService(IStorageService storage) : IConversationService

src/WhatsApp/WhatsAppServiceCollectionExtensions.cs:31

  • Requiring IConfiguration in every AddWhatsApp overload is a breaking change. Consider providing a fallback overload that resolves IConfiguration from the service provider to preserve backwards compatibility.
return AddWhatsApp(collection, configuration, _ => handler, lifetime);

src/WhatsApp/StorageService.cs:39

  • FeatureFlags.Storage is defined but never used. If the intention is to gate storage operations, consider checking featureManager.IsEnabledAsync(FeatureFlags.Storage) before saving messages or conversations.
if (!string.IsNullOrEmpty(message.ConversationId) && await featureManager.IsEnabledAsync(FeatureFlags.Conversation))

@kzu kzu merged commit 2be69f5 into main Jun 6, 2025
3 checks passed
@kzu kzu deleted the dev/adalon/ConversationTable branch June 6, 2025 16:40
@devlooped devlooped locked and limited conversation to collaborators Jul 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants