Status-react: Chat screen is flickering

Created on 5 Apr 2020  Â·  5Comments  Â·  Source: status-im/status-react

Bug Report

version 1.1.0 iPhone

Problem

Poor Majestic Icelandgull:
It just jumps, as if it’s refreshing the chat.
For example, if you scroll up a few messages and then someone sends a new message to the chat, you will notice the chat jump so you know a new message has appeared.
Now imagine this happening instantly every 4/5 seconds.
It’s not doing it now. But if I came out of status and then came back in half an hour it would probably be doing it again.
It’s intermittent but when it does happen, it happens a lot.

But the other day I typed a reply to someone and when I hit send the message just disappeared due to the flickering.

Expected behavior

no flickering

bug high-priority high-severity

Most helpful comment

Steps to replicate:

1) Open a public chat
2) Publish a very long message
3) Reply to that message, with a very long message
4) Repeat step 3

The screen will start flickering every 5s

The issue is that for some messages (the ones that are not loaded from the database, for example if you posted them yourself or just received), we use a subscription for the reply text.

This is because replies might come out of order, for example you receive first the message that has a reply, but you haven't received the reply yet, eventually you receive the reply.

In this case, once we offload the message from the database, the reply will disappear, and then is loaded back again as we reached onEndReached, and it appears again, which counts as a scroll, re-triggering the behavior.

One solution is to make sure that the reply is stored always in the message, which means more work needs to be done on receiving the message, but would avoid this scenario.

All 5 comments

reproduced this one

image

Nice, thanks
This happens because we offload messages, and then we hit onEndReached and we load them back.

Basically we should offload message up to onEndReached and no more, so that offloading messages does not trigger it.

I will take a look at it tomorrow.

Steps to replicate:

1) Open a public chat
2) Publish a very long message
3) Reply to that message, with a very long message
4) Repeat step 3

The screen will start flickering every 5s

The issue is that for some messages (the ones that are not loaded from the database, for example if you posted them yourself or just received), we use a subscription for the reply text.

This is because replies might come out of order, for example you receive first the message that has a reply, but you haven't received the reply yet, eventually you receive the reply.

In this case, once we offload the message from the database, the reply will disappear, and then is loaded back again as we reached onEndReached, and it appears again, which counts as a scroll, re-triggering the behavior.

One solution is to make sure that the reply is stored always in the message, which means more work needs to be done on receiving the message, but would avoid this scenario.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukaszfryc picture lukaszfryc  Â·  3Comments

rachelhamlin picture rachelhamlin  Â·  3Comments

andmironov picture andmironov  Â·  3Comments

churik picture churik  Â·  3Comments

alwx picture alwx  Â·  4Comments