Skip to content

[CLNP-7360]Multiple Chat Windows cause unexpected behavior #1358

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

Merged
merged 1 commit into from
Jul 29, 2025

Conversation

danney-chun
Copy link
Contributor

@danney-chun danney-chun commented Jul 24, 2025

[fix]: Multiple Chat Windows cause unexpected behavior

PR description

  • initialState안에 xxxRef들이 Object로 되어 있어서 여러 Provider 인스턴스가 생성될 때 동일한 객체 참조를 공유하는 문제가 있었습니다. 함수로 변경함으로써 각 Provider 인스턴스마다 새로운 초기 상태 객체를 생성하도록 하여 상태 격리 문제를 해결했습니다.

Fixes CLNP-7360

Changelogs

  • Fixed a bug Where Multiple Chat Windows cause unexpected behavior

Checklist

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.

  • 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)

External Contributions

This project is not yet set up to accept pull requests from external contributors.

If you have a pull request that you believe should be accepted, please contact
the Developer Relations team [email protected] with details
and we'll evaluate if we can set up a CLA to allow for the contribution.

@danney-chun danney-chun self-assigned this Jul 24, 2025
Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for sendbird-uikit-react ready!

Name Link
🔨 Latest commit a6fbc42
🔍 Latest deploy log https://app.netlify.com/projects/sendbird-uikit-react/deploys/6881780c5766f50008527549
😎 Deploy Preview https://deploy-preview-1358--sendbird-uikit-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@danney-chun danney-chun requested a review from Copilot July 24, 2025 00:02
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a state isolation issue that caused unexpected behavior when multiple chat windows were open simultaneously. The problem occurred because initial state objects were being shared across multiple Provider instances due to object references.

  • Converted static initial state objects to factory functions
  • Ensured each Provider instance gets its own isolated state
  • Fixed state sharing issues across Thread, GroupChannelList, and GroupChannel contexts

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/modules/Thread/context/ThreadProvider.tsx Converted initialState from object to factory function and updated all references
src/modules/GroupChannelList/context/GroupChannelListProvider.tsx Converted initialState from object to factory function and updated all references
src/modules/GroupChannel/context/GroupChannelProvider.tsx Converted initialState from object to factory function and updated all references

Copy link
Collaborator

@chrisallo chrisallo left a comment

Choose a reason for hiding this comment

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

lgtm! 구현해주신 함수를 쓰는것도 방법이고 객체를 { ...initialState }로 하드 카피하는것도 괜찮을것같네요ㅎㅎ

@danney-chun
Copy link
Contributor Author

lgtm! 구현해주신 함수를 쓰는것도 방법이고 객체를 { ...initialState }로 하드 카피하는것도 괜찮을것같네요ㅎㅎ

하드 카피 방식도 고려 했다가, 코드 모양이 그냥 좀더 이뻐 보여서.. 함수로 했습니다. ㅎㅎ

@danney-chun danney-chun merged commit 0c5fa0f into main Jul 29, 2025
10 checks passed
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