Add IStreamClientConfig.OptimisticMessageInsert to opt out of optimistic local message insertion#212
Open
harlan wants to merge 1 commit into
Open
Conversation
…tic local message insertion By default a sent message is inserted into the local channel state and raised via IStreamChannel.MessageReceived immediately, before the server's message.new WebSocket echo arrives (the echo is then de-duplicated). Some apps need every participant - including the sender - to observe messages in a single server-defined order, where instant local feedback is undesirable. Add OptimisticMessageInsert (default true; no behavior change). When false, SendNewMessageAsync skips the optimistic local insert and only updates the message cache, letting the server's message.new echo deliver the sender's own message so it arrives in the same order for all participants. Thread ReplyCount accounting and the WebSocket receive/dedup path are unchanged. Client-level config to match the existing LogLevel pattern and keep the change minimal. Signed-off-by: Harlan Crystal <harlan@pocketgems.com>
Author
|
@sierpinskid Looks like CI failed, but it's a bunch of errors talking about unity licenses |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
By default a sent message is inserted into the local channel state and raised via IStreamChannel.MessageReceived immediately, before the server's message.new WebSocket echo arrives (the echo is then de-duplicated). Some apps need every participant - including the sender - to observe messages in a single server-defined order, where instant local feedback is undesirable.
Add OptimisticMessageInsert (default true; no behavior change). When false, SendNewMessageAsync skips the optimistic local insert and only updates the message cache, letting the server's message.new echo deliver the sender's own message so it arrives in the same order for all participants. Thread ReplyCount accounting and the WebSocket receive/dedup path are unchanged.
Client-level config to match the existing LogLevel pattern and keep the change minimal.