Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(messagesStore): don't update parent message in the store, if it hasn't been unchanged #11638

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

Antreesy
Copy link
Contributor

☑️ Resolves

  • Fix excessive store updates:
    • When first time loading the chat, we already have the parent message up-to-date from the API
    • message_deleted, message_edited, reaction... requested at the same time (not new) contains same parent message without changes, so we don't need to update it again and trigger sideEffect (messagesList re-render)
    • deleteMessage, editMessage, addReaction API requests return parent to update it. When it comes again with message long polling, we also don't need to update it

🖌️ UI Checklist

🖼️ Screenshots / Screencasts

No visual changes

🏁 Checklist

  • 🌏 Tested with Chrome, Firefox and Safari or should not be risky to browser differences
  • ⛑️ Tests are included or not possible

…asn't been unchanged

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Copy link
Contributor

@DorraJaouad DorraJaouad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@Antreesy Antreesy enabled auto-merge February 23, 2024 17:21
@Antreesy Antreesy merged commit 9a1fa86 into main Feb 23, 2024
45 checks passed
@Antreesy Antreesy deleted the fix/noid/keep-unchanged-parents branch February 23, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants