wireapp / wire-webapp

👽 Wire for web
https://app.wire.com
GNU General Public License v3.0
1.12k stars 290 forks source link

fix: Disable automatic scroll detection when messages are being loaded [WPB-5402] #17642

Closed atomrc closed 1 week ago

atomrc commented 1 week ago
BugWPB-5402 [Web] Jumping to a quoted message and scrolling down misses a lot of messages


Description

When we click on the original message button of a quote (that is not currently in the loaded messages), we:

The thing is: emptying the message list triggers a scroll event that will automatically load more messages (the last ones).

This is conflicting as we are loading both the messages around the original message AND the last messages, but not the messages in between.

This PR fixes this behavior by setting the loaded state to false before changing anything in the message list. This prevents all the scroll events to be ignored while we load the messages.

Screenshots/Screencast (for UI changes)

Before

The conversation only has a handful of messages and is missing a lot of messages in between

https://github.com/wireapp/wire-webapp/assets/1090716/01039f90-cc98-4ef4-9460-0082dfcb00a1

After

All the messages between the original message and the latest received messages are here

https://github.com/wireapp/wire-webapp/assets/1090716/4bdec83b-ff80-4b58-8404-7f1d66cbd6c4

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 46.13%. Comparing base (2e821fe) to head (feff959). Report is 1 commits behind head on dev.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #17642 +/- ## ========================================== - Coverage 46.14% 46.13% -0.01% ========================================== Files 760 760 Lines 24992 24994 +2 Branches 5720 5720 ========================================== - Hits 11532 11531 -1 - Misses 12017 12019 +2 - Partials 1443 1444 +1 ```