-
Notifications
You must be signed in to change notification settings - Fork 143
[CLNP-5817][CLNP-5918] fix: scroll & search message issues in GroupChannelProvider #1263
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
[CLNP-5817][CLNP-5918] fix: scroll & search message issues in GroupChannelProvider #1263
Conversation
✅ Deploy Preview for sendbird-uikit-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| const [isScrollBottomReached, setIsScrollBottomReached] = useState(true); | ||
| const { | ||
| state: { isScrollBottomReached }, | ||
| actions: { setIsScrollBottomReached }, | ||
| } = useGroupChannel(); |
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.
This change is for https://sendbird.atlassian.net/browse/CLNP-5918
HoonBaek
left a comment
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.
LGTM!
…annelProvider (#1263) Fixes - https://sendbird.atlassian.net/browse/CLNP-5917 - https://sendbird.atlassian.net/browse/CLNP-5918 ### Changes To fix [CLNP-5917](https://sendbird.atlassian.net/browse/CLNP-5917) introduced optimizations to prevent the "Maximum update depth exceeded" error that occurs during message searches: 1. Added useDeepCompareEffect hook: - Performs deep comparison of dependencies instead of reference equality - Particularly useful for handling message array updates efficiently - Inspired by [kentcdodds/use-deep-compare-effect](https://github.com/kentcdodds/use-deep-compare-effect) 2. Enhanced useStore with state change detection: - Added hasStateChanged helper to compare previous and next states - Prevents unnecessary updates when state values haven't actually changed - Optimizes performance by reducing redundant renders 3. Improved storeManager with nested update prevention: - Added protection against nested state updates - Prevents infinite update cycles Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If unsure, ask the members. This is a reminder of what we look for before merging your code. - [x] **All tests pass locally with my changes** - [ ] **I have added tests that prove my fix is effective or that my feature works** - [ ] **Public components / utils / props are appropriately exported** - [ ] I have added necessary documentation (if appropriate) [CLNP-5917]: https://sendbird.atlassian.net/browse/CLNP-5917?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
…annelProvider (#1263) Fixes - https://sendbird.atlassian.net/browse/CLNP-5917 - https://sendbird.atlassian.net/browse/CLNP-5918 ### Changes To fix [CLNP-5917](https://sendbird.atlassian.net/browse/CLNP-5917) introduced optimizations to prevent the "Maximum update depth exceeded" error that occurs during message searches: 1. Added useDeepCompareEffect hook: - Performs deep comparison of dependencies instead of reference equality - Particularly useful for handling message array updates efficiently - Inspired by [kentcdodds/use-deep-compare-effect](https://github.com/kentcdodds/use-deep-compare-effect) 2. Enhanced useStore with state change detection: - Added hasStateChanged helper to compare previous and next states - Prevents unnecessary updates when state values haven't actually changed - Optimizes performance by reducing redundant renders 3. Improved storeManager with nested update prevention: - Added protection against nested state updates - Prevents infinite update cycles Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If unsure, ask the members. This is a reminder of what we look for before merging your code. - [x] **All tests pass locally with my changes** - [ ] **I have added tests that prove my fix is effective or that my feature works** - [ ] **Public components / utils / props are appropriately exported** - [ ] I have added necessary documentation (if appropriate) [CLNP-5917]: https://sendbird.atlassian.net/browse/CLNP-5917?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
…annelProvider (#1263) Fixes - https://sendbird.atlassian.net/browse/CLNP-5917 - https://sendbird.atlassian.net/browse/CLNP-5918 ### Changes To fix [CLNP-5917](https://sendbird.atlassian.net/browse/CLNP-5917) introduced optimizations to prevent the "Maximum update depth exceeded" error that occurs during message searches: 1. Added useDeepCompareEffect hook: - Performs deep comparison of dependencies instead of reference equality - Particularly useful for handling message array updates efficiently - Inspired by [kentcdodds/use-deep-compare-effect](https://github.com/kentcdodds/use-deep-compare-effect) 2. Enhanced useStore with state change detection: - Added hasStateChanged helper to compare previous and next states - Prevents unnecessary updates when state values haven't actually changed - Optimizes performance by reducing redundant renders 3. Improved storeManager with nested update prevention: - Added protection against nested state updates - Prevents infinite update cycles Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If unsure, ask the members. This is a reminder of what we look for before merging your code. - [x] **All tests pass locally with my changes** - [ ] **I have added tests that prove my fix is effective or that my feature works** - [ ] **Public components / utils / props are appropriately exported** - [ ] I have added necessary documentation (if appropriate) [CLNP-5917]: https://sendbird.atlassian.net/browse/CLNP-5917?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Fixes
Changes
To fix CLNP-5917 introduced optimizations to prevent the "Maximum update depth exceeded" error that occurs during message searches:
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If unsure, ask the members.This is a reminder of what we look for before merging your code.