Skip to content

Fix intermittent missing new message count badge (Issue #4110)#4111

Open
abhiramvsmg wants to merge 2 commits into
conversejs:masterfrom
abhiramvsmg:master
Open

Fix intermittent missing new message count badge (Issue #4110)#4111
abhiramvsmg wants to merge 2 commits into
conversejs:masterfrom
abhiramvsmg:master

Conversation

@abhiramvsmg

Copy link
Copy Markdown

This fixes a timing race condition where the roster badge fails to update with new unread messages if they arrive before the linked roster contact object has finished loading asynchronously.

Changes :

Fix : Added a call to this.updateContactUnreadCounter() inside setModelContact in src/headless/shared/model-with-contact.js to sync the unread counter as soon as the contact resolves.

Test : Added a regression integration test in src/headless/plugins/chat/tests/chat.js that mock-delays the contact load, sets the unread count, and asserts that the contact's unread badge synchronizes correctly upon resolution.

Changelog : Added an entry for Issue #4110 in CHANGES.md.

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.

1 participant