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

Aperta Adatta ai principianti
#7,098 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@deepak0x ci sta già lavorando.

Dal 13/4/2026.

  • #7144 di @deepak0x — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
react-native, typescript
Ambito
mobile

Direzione di ricerca

Inizia in app/lib/methods/helpers/goRoom.ts, in particolare nel blocco catch alle righe 111–113 e nella navigazione alle righe 121–129, quindi esamina search.ts:157 per comprendere il rid del risultato. Assicurati che la creazione di DM fallita o non riuscita non raggiunga la navigazione di RoomView e verifica che entrambi i percorsi di errore mantengano l’utente nella schermata di ricerca.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)

Lingua principale
TypeScript
Stelle
2.4k
Fork
1.5k
Merge medio
1g 15h
PR unite (30g)
29

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RocketChat/Rocket.Chat.ReactNative

Tutte le issue di RocketChat/Rocket.Chat.ReactNative

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.