You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous default of 1000 ms for the interval was removed; the new SendingInterval has no default. Verify that all callers set a positive value or that downstream logic handles null/zero appropriately to avoid tight loops or no delays.
/// <summary>/// Messages sending interval in milliseconds/// </summary>publicintSendingInterval{get;set;}/// <summary>/// Whether the Messages are saved to db/// </summary>publicboolSaveToDb{get;set;}/// <summary>/// Messages to send or save/// </summary>publicList<RoleDialogModel>?Messages{get;set;}
The condition uses wrapper?.SendingInterval > 0 and wrapper?.Messages?.Count > 0. While safe, ensure that when wrapper is null or interval <= 0, the intended fallback behavior (no typing-on and no additional messages) is correct and does not regress user experience.
Without a default value this becomes 0, which stops additional messages from being sent under the new check. Set a sensible default to preserve prior behavior and prevent silent skips.
/// <summary>
/// Messages sending interval in milliseconds
/// </summary>
-public int SendingInterval { get; set; }+public int SendingInterval { get; set; } = 1000;
Apply / Chat
Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies that removing the default value from SendingInterval introduces a behavioral regression, and proposes restoring the default value, which is a direct and effective fix for the issue.
High
Fix nullable check and default delay
The null-conditional comparison returns a nullable bool, causing a compile error in the if condition. Also, if SendingInterval is unset (0), additional messages will never send. Coalesce counts and inject a safe default delay to ensure both compilation and expected behavior.
Why: The suggestion correctly identifies that messages will not be sent if SendingInterval is 0 (its new default), and proposes a robust fix by using a default delay, thus preventing a silent regression introduced by the PR.
Medium
More
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement
Description
Renamed
IntervalMilliSecondstoSendingIntervalfor clarityAdded comprehensive XML documentation to
ChatMessageWrapperpropertiesImproved conditional logic for message wrapper validation
Diagram Walkthrough
File Walkthrough
RoleDialogModel.cs
Enhance ChatMessageWrapper with better naming and docssrc/Infrastructure/BotSharp.Abstraction/Conversations/Models/RoleDialogModel.cs
IntervalMilliSecondsproperty toSendingIntervalPlotChartFn.cs
Update property reference to new namesrc/Plugins/BotSharp.Plugin.ChartHandler/Functions/PlotChartFn.cs
IntervalMilliSecondstoSendingIntervalChatHubConversationHook.cs
Refactor message wrapper usage with improved validationsrc/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs
IntervalMilliSecondstoSendingIntervalwrapperfor cleaner codeSendingInterval > 0