Bug: Incomplete logout leaves UI stuck in authenticated state when channel is missing or access is denied in ChatHeader.js
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- javascript, react
- 領域
- frontend
調査の方向性
Start in packages/react/src/views/ChatHeader/ChatHeader.js at getChannelInfo (lines 202–288) and compare its two error branches with handleLogout() in the same file, noting which state resets are skipped. Also inspect the unguarded RCInstance.channelInfo() and setMessageAllowed paths. Done means both error branches reach the logout state reset and null/rejected responses are handled; verify by authenticating with a non-existent roomId. A linked open pull request (#1428) already covers this work, so read it before starting.
索引モデルが issue の本文から書いたものです。
説明
Description
In packages/react/src/views/ChatHeader/ChatHeader.js, when getChannelInfo encounters an 'error-room-not-found' or 'Not Allowed' error, it dispatches an error toast ("Logging out") and calls await RCInstance.logout() directly instead of invoking handleLogout().
Because handleLogout() is bypassed:
setIsUserAuthenticated(false)is never called, leaving the React UI permanently stuck in the authenticated view even though the backend session has been terminated.- Stores and UI state (
setMessages([]),setChannelInfo({}),setShowSidebar(false),setUserAvatarUrl(null), andisMessageLoaded) are not reset. - Additionally,
getChannelInfoandsetMessageAllowedlacktry...catchblocks and safe optional chaining (res?.success,res && 'errorType' in res), which can cause an unhandledTypeErrorcrash ifRCInstance.channelInfo()returnsundefinedor rejects on network failure.
Affected File
packages/react/src/views/ChatHeader/ChatHeader.js(lines 202–288)
Steps to Reproduce
- Authenticate into EmbeddedChat configured with a non-existent
roomId(error-room-not-found) or a restricted private room where the user lacks permission (Not Allowed). - Observe the toast message:
"Channel doesn't exist. Logging out."or"You don't have permission to access this channel. Logging out". - Notice that while
RCInstance.logout()runs,isUserAuthenticatedremainstrueand the UI stays stuck in the logged-in state instead of returning to the login state.
Expected Behavior
- Error-triggered logouts in
getChannelInfoshould callawait handleLogout()so thatisUserAuthenticatedis set tofalseand all user/channel/message stores are properly cleared. - Async calls in
getChannelInfoandsetMessageAllowedshould safely guard against null/undefined responses and network rejections.
- 主要言語
- JavaScript
- スター
- 170
- フォーク
- 397
- 平均マージ
- 12日 14時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RocketChat/EmbeddedChat のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
RocketChat/EmbeddedChat#1429 ·
メンテナーはふだん 1 日以内に返信
-
docs: README says Node 22 is required, but .nvmrc pins v24 and preinstall enforces it対応中かも @Veerpratapgupta が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
RocketChat/EmbeddedChat#1377 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
test: isMessageSequential in layout_editor has no coverage再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
RocketChat/EmbeddedChat#1373 ·
メンテナーはふだん 1 日以内に返信
-
Permissions change-detection in useFetchChatData is dead — applyPermissions re-runs on every call対応中かも @yash113gadia が 166 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
RocketChat/EmbeddedChat#1317 ·
メンテナーはふだん 1 日以内に返信
-
Only the last emoji shortname in a message is converted to unicode対応中かも @yash113gadia が 166 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
RocketChat/EmbeddedChat#1315 ·
メンテナーはふだん 1 日以内に返信
RocketChat/EmbeddedChat の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
webtorrent/webtorrent#3131 ·
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
trustjonathan/STUDY-HUB#15 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100