bug: goRoom navigates to broken RoomView after failed DM creation from search

オープン 初心者向け
#7,098 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@deepak0x がすでに取り組んでいます。

2026年4月13日 から。

  • #7144 @deepak0x による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
react-native, typescript
領域
mobile

調査の方向性

app/lib/methods/helpers/goRoom.ts から始め、特に 111–113 行目の catch ブロックと 121–129 行目のナビゲーションを確認し、その後 search.ts:157 を調べて結果の rid を理解してください。失敗した、または成功しなかった DM 作成が RoomView ナビゲーションに到達しないことを確認し、両方のエラーパスでユーザーが検索画面に留まることを検証してください。

索引モデルが issue の本文から書いたものです。

説明

type: bug

In app/lib/methods/helpers/goRoom.ts, when a user taps a spotlight search result to open a DM and createDirectMessage fails (network error, invalid user, etc.), the catch block at lines 111–113 emits an error toast but does not return. Execution falls through to lines 121–129, which navigates to RoomView with the search item's rid — which is the username string (set by search.ts:157 as rid: user.username), not a real Rocket.Chat room ID.

The result: the user sees an error toast AND gets navigated to a broken/empty RoomView that can't load any room data.

There's a second trigger: if createDirectMessage succeeds but returns { success: false } (or result.room._id is falsy), the try block exits without returning, and the same fallthrough occurs.

Steps to Reproduce
  1. Open the app, go to the rooms list
  2. Tap the search icon and search for a username
  3. Simulate a failure condition (e.g., airplane mode, or search for a user that doesn't exist on the server but appears in spotlight)
  4. Tap the user result to open a DM
  5. createDirectMessage fails → error toast appears
  6. Observe: app navigates to a broken/empty RoomView instead of staying on the search screen
Expected Behavior

After a failed DM creation, the user should stay on the current screen. The error toast from emitErrorCreateDirectMessage is sufficient feedback. No navigation should occur.

Actual Behavior

The error toast is shown, but execution falls through past the catch block. The app navigates to RoomView with rid set to the username string (e.g., "john"). RoomView tries to load a room with this invalid rid from WatermelonDB, finds nothing, and shows a blank/broken screen.

Rocket.Chat Server Version

Not applicable — client-side bug

Rocket.Chat App Version

Latest develop branch

Device Name

Any

OS Version

Any (iOS and Android)

主要言語
TypeScript
スター
2.4k
フォーク
1.5k
平均マージ
1日 15時間
マージ済み PR(30日)
29

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RocketChat/Rocket.Chat.ReactNative のほかの issue

RocketChat/Rocket.Chat.ReactNative の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。