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(MessagesList): Stop fetching when reaching the chat beginning #11663

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

DorraJaouad
Copy link
Contributor

☑️ Resolves

Old messages were fetched on every scroll event even though messages list weren't updated -> lost requests

Create a flag to stop fetching when :

  • We reach system messages conversation_created and history_cleared
  • For chats that don't have such, we wait another request and compare if in both times the list didn't change then we confirm that the very beginning of the chat was reached ( this case applies to chats that have expiration messages, and history cleared after setting it)

🖌️ UI Checklist

🖼️ Screenshots / Screencasts

No visual changes just spinner doesn't show up when you scroll up at the top.

@DorraJaouad DorraJaouad self-assigned this Feb 27, 2024
@DorraJaouad DorraJaouad added this to the 💞 Next Major (29) milestone Feb 27, 2024
@nickvergessen
Copy link
Member

For chats that don't have such, we wait another request and compare if in both times the list didn't change then we confirm that the very beginning of the chat was reached ( this case applies to chats that have expiration messages, and history cleared after setting it)

This can also happen when you have a full page of "hidden system messages" e.g. reactions only

…top of the messages list

Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
@DorraJaouad DorraJaouad force-pushed the fix/noid/messages-fetches branch from 1abce7b to cfc6bd9 Compare February 28, 2024 08:08
Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

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

Tested for these 3 cases, should be enough to cover, and don't break anything

@Antreesy Antreesy changed the title chore(MessagesList): Stop fetching when reaching the top fix(MessagesList): Stop fetching when reaching the chat beginning Feb 28, 2024
@DorraJaouad DorraJaouad merged commit 0e1ebde into main Feb 28, 2024
45 checks passed
@DorraJaouad DorraJaouad deleted the fix/noid/messages-fetches branch February 28, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: chat 💬 Chat and system messages technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants