Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reply_count from Thread did not remove deleted message when flag hideDeletedMessage is used #1975

Open
neopit opened this issue Mar 15, 2023 · 4 comments
Labels
bug Something isn't working needs api support requires backend support to resolve status:confirmed Described issue has been reproduced by the repo maintainer

Comments

@neopit
Copy link

neopit commented Mar 15, 2023

Describe the bug

On a ThreadList (message list ...), it is possible to provide props for hiding the delete message (https://getstream.io/chat/docs/sdk/react/components/core-components/virtualized_list/#hidedeletedmessages).

When we enabled this feature then the reply_count counter is still returning the number of replies and continue to count deleted messages.

To Reproduce

  1. Configure the component for showing the deleted messages
  2. Create 2 messages in the
  3. Now delete a message in the Thread -> a bubble indicates the message is deleted and the number of replies = 2

run the app again now with hideDeletedMessages=true on the component

  1. Configure the same (hideDeletedMessages=true) for hiding the delete message.
  2. Go back in the Thread (the bubble of the deleted messages disappeared) BUT the number of replies is still 2.

We expect to see only one reply because all deleted messages are hiding

Important: The MessageList shows as well the number of reply_count and it is incorrect on the message list as well.

Expected behavior

When the hideDeletedMessages is true then we expect reply_count to avoid counting deleted messages

Screenshots

If applicable, add screenshots to help explain your problem.

Package version

  • stream-chat-react: v10.7.2
  • stream-chat-css: N/A
  • stream-chat-js: N/A

Desktop (please complete the following information):
All platforms, all browsers, all OS

Smartphone (please complete the following information):

  • All devices

Additional context

Screenshot 2023-03-15 at 2 54 51 PM

Screenshot 2023-03-15 at 2 55 06 PM

@neopit neopit added bug Something isn't working status: unconfirmed labels Mar 15, 2023
@neopit neopit changed the title bug: bug: reply_count from Thread did not remove deleted message when flag hideDeletedMessage is used Mar 15, 2023
@neopit neopit changed the title bug: reply_count from Thread did not remove deleted message when flag hideDeletedMessage is used reply_count from Thread did not remove deleted message when flag hideDeletedMessage is used Mar 15, 2023
@MartinCupela MartinCupela added status:confirmed Described issue has been reproduced by the repo maintainer and removed status: unconfirmed labels Mar 16, 2023
@MartinCupela
Copy link
Contributor

@neopit thank you for reporting this. We are working on the fix.

@MartinCupela MartinCupela added the needs api support requires backend support to resolve label Mar 16, 2023
@MartinCupela
Copy link
Contributor

@neopit we will not be able to solve this issue immediately. For this to happen, we need some changes on the API side. For the moment, if your priority is the consistency, I would recommend not to use the flag hideDeletedMessages.

@neopit
Copy link
Author

neopit commented Mar 21, 2023

@MartinCupela I discovered something else, it looks like the rules are not similar between Mobile (react-native project) and web (react project).

On react-native, the deleted messages are not counted but on the react project the deleted messages are counted. So it seems the rule is not similar between the 2 projects.

I believe the react-native is correct, if a message is deleted (hidden or not) then it does not have to be counted as a reply. From this and if agreed, the fix on the web would be easier and would not need any API change I believe.

@MartinCupela
Copy link
Contributor

MartinCupela commented Apr 3, 2023

@neopit the RN SDK is using directly the reply_count value from the message object. That is the same, what the React SDK does. As the JS client is not receiving information about the deleted messages in the main message list, it cannot adjust the resulting count. Also, if you open a thread with let's say 1K messages, the client still does not get the information about the total number of deleted messages (as only a fraction of messages is retrieved and then pagination takes place).

This feature needs API support to work reliably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs api support requires backend support to resolve status:confirmed Described issue has been reproduced by the repo maintainer
Projects
None yet
Development

No branches or pull requests

2 participants