-
Notifications
You must be signed in to change notification settings - Fork 279
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: avoid eager channel pagination on channel open #2425
fix: avoid eager channel pagination on channel open #2425
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2425 +/- ##
==========================================
+ Coverage 85.21% 85.45% +0.23%
==========================================
Files 372 392 +20
Lines 7983 9084 +1101
Branches 1914 2347 +433
==========================================
+ Hits 6803 7763 +960
- Misses 1087 1120 +33
- Partials 93 201 +108 ☔ View full report in Codecov by Sentry. |
@@ -93,7 +95,12 @@ export const InfiniteScroll = (props: PropsWithChildren<InfiniteScrollProps>) => | |||
} | |||
|
|||
if (isLoading) return; | |||
// FIXME: this triggers loadMore call when a user types messages in thread and the scroll container container expands | |||
if (previousOffset.current === offset && previousReverseOffset.current === reverseOffset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevents duplicate queries when the dimensions do not change.
Size Change: +118 B (+0.02%) Total Size: 755 kB
ℹ️ View Unchanged
|
## [11.22.0](v11.21.0...v11.22.0) (2024-06-21) ### Bug Fixes * adjust ChannelActionContextValue type ([#2434](#2434)) ([977ec39](977ec39)) * avoid eager channel pagination on channel open ([#2425](#2425)) ([c1e8b93](c1e8b93)) * keep line breaks in message text that contains multiple markdown elements ([#2429](#2429)) ([11e606f](11e606f)) ### Features * load lazily mp3 encoding library for audio recorder ([#2432](#2432)) ([2ca3188](2ca3188))
🎉 This PR is included in version 11.22.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎯 Goal
Eager channel pagination lead to problems in Safari. More messages were queried on channel opening which increased the scroll size of the container. Safari does not adjust container scrollTop on prepending new items. The SDK logic however relies on scroll events to maintain the list scrolled to the bottom. As a result the container was not scrolled to the bottom in Safari.