fix(mam): Prevent duplicated and out-of-order history messages#2183
Merged
Conversation
This resolves an issue where MAM history messages were being appended to the window display buffer in as they arrived, causing them to appear out of order and duplicated when the RSM batch completed and prepended the same sorted messages. Bypass immediate display and file logging for MAM messages and allow them to only be saved to the database. Render them in a single chronological block once the query completes. So in server_events.c we now only decrypt and save MAM messages to db. Once we receive `<fin>` we trigger `_mam_rsm_id_handler()` and `_mam_buffer_commit_handler()` which call `mucwin_db_history() and `chatwin_db_history()` which will query the DB and print them to the screen via `win_print_old_history()`. Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Member
Author
|
Confirmed by bug reporter maniac in our MUC. |
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.
This resolves an issue where MAM history messages were being appended to the window display buffer in as they arrived, causing them to appear out of order and duplicated when the RSM batch completed and prepended the same sorted messages.
Bypass immediate display and file logging for MAM messages and allow them to only be saved to the database.
Render them in a single chronological block once the query completes.
So in server_events.c we now only decrypt and save MAM messages to db. Once we receive
<fin>we trigger_mam_rsm_id_handler()and_mam_buffer_commit_handler()which callmucwin_db_history() andchatwin_db_history()which will query the DB and print them to the screen viawin_print_old_history()`.