RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.57k stars 10.59k forks source link

[BUG]: Unable to replace the query string parameter; it instead appends to it. #31767

Open Spiral-Memory opened 8 months ago

Spiral-Memory commented 8 months ago

Description:

Currently, when quoting a message and sending it, the message link gets wrapped inside the time text/box, which is inappropriate behavior. It doesn't make much sense. Instead, the quoted message should be wrapped over the complete box so that if anyone clicks on that box, they will be scrolled towards that message easily.

Steps to reproduce:

  1. Open Rocket.Chat.
  2. Send a message, for example, "Hi," with mentioning someone in the channel.
  3. Open the mentions tab and click on Jump to Message.
  4. Click it multiple times; the query parameter will get added multiple times rather than replacing it.
  5. Also, this will prohibit us from jumping to another message if I have already jumped to one.
  6. The same behavior is present in pinned messages or starred messages.

Expected behavior:

Every time we jump to a message, it should replace the query parameter to go to the specific message.

Actual behavior:

The query parameter gets appended to the previous one, causing unexpected behavior.

https://github.com/RocketChat/Rocket.Chat/assets/78961432/3c45656a-2d33-43e6-a456-f61d85baef60

Server Setup Information:

Client Setup Information

Spiral-Memory commented 8 months ago

@hugocostadev @dougfabris @tassoevan , I would like to work on this issue. I tried debugging the problem, but it seems like replace: true is already being sent to the navigate function. Could you please help me understand what might be the issue then? I suspect it might be related to the navigate function itself, which could be associated with the @rocket.chat/ui-contexts module. I am not sure; I need a little guidance to move forward with it. If you also feel that it needs to be fixed, your assistance would be greatly appreciated.

image