Rocket.chat.reactnative: Error when accessing threads of a channel that one has not joined

Created on 8 Dec 2019  路  6Comments  路  Source: RocketChat/Rocket.Chat.ReactNative

  • Your Rocket.Chat Experimental app version: 1.25.0.9999...
  • Your Rocket.Chat server version: 3.0.0-develop open.rocket.chat
  • Device (or Simulator) you're running with: Android P Sumsung Galaxy J6

ezgif com-video-to-gif(6)

As the gif shows, the app shows shows error, when one try to access threads of a channel that he has not joined.

馃嵀 good first issue 馃悰 bug

All 6 comments

@diegolmello
app > views > ThreadMessagesView> index.js > line no 100 inside subsribeData() function. when I comment out the code on line 100, the error disappears, and everything works fine, but I am not able to understand why this is so.

Screenshot from 2019-12-26 12-21-50

@Prateek93a try change findAndObserve to two functions like:

try {
  const db = database.active;
  const subCollection = await db.collections.get('subscriptions');
  const subscription = await subCollection.find(this.rid);
  const observable = subscription.observe();
  this.subSubscription = observable
    .subscribe(changes => console.log(changes));
catch (e) {
  console.log('subscription not found');
}

Unfortunately the function findAndObserve not works fine, when the object is not found this not throw an error..

@djorkaeffalexandre Yes Sir your solution worked, since the findAndObserve was not throwing error, the app was crashing. Now after splitting the function, the error got thrown and logged out in the console, without crashing the app. So the solution is working.

;)

hey @Prateek93a, can you confirm if it's happening yet?
I followed your gif here and can't reproduce any error.

@djorkaeffalexandre I can't reproduce it. I think it was fixed by #1997. Closing it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Perflyst picture Perflyst  路  5Comments

sd1998 picture sd1998  路  4Comments

sadeghpro picture sadeghpro  路  5Comments

venkatasubramanis picture venkatasubramanis  路  5Comments

monarkh-karina picture monarkh-karina  路  4Comments