tasking-manager icon indicating copy to clipboard operation
tasking-manager copied to clipboard

Error 404 when comment using mention i.e. @[user]

Open manjitapandey opened this issue 1 year ago • 4 comments

Describe the bug When commenting on comment section during project mapping, validation as well as Question and answer section, mentioning to any user gives error 404. image

To Reproduce Steps to reproduce the behavior:

  1. Go to project page
  2. Select task to map or validate
  3. Comment on the task by mentioning
  4. See error on in network tab

Screenshots image image image

Additional context The error doesn't disturb on the workflow i.e. user will be able to perform/submit mapping and validation.

manjitapandey avatar Dec 15 '23 10:12 manjitapandey

@ramyaragupathy working on this issue

Aadesh-Baral avatar Jan 14 '24 14:01 Aadesh-Baral

Hey @Aadesh-Baral, when are you planning to look into this issue? Did you find anything yet?

royallsilwallz avatar Jan 16 '24 08:01 royallsilwallz

Hi @royallsilwallz, I've been investigating the issue, and it appears to be related to the frontend. It seems there might be a problem either in our implementation of TributeJS for mentions or in TributeJS itself. Specifically, when a user is mentioned and the Tribute popup is closed, the user search endpoint should not be triggered. Currently, we are making a request to the user search endpoint with every key press in the text area, considering the text after @ as the search query even after the popup is closed.

One potential solution could be to use the tribute.isActive flag to check if the Tribute popup is open before making a request to the user search endpoint. However, there seems to be an issue in implementing this approach. The problem lies in the fact that the tribute.isActive flag returns false and then immediately true once the menu is closed. Here's the sequence of events:

  • User presses @ -> Tribute popup opens, and tribute.isActive flag is set to true.
  • User starts typing a username -> A request is made to the user search endpoint, and the results are displayed in the Tributejs popup menu. tribute.isActive flag is still true.
  • User clicks on any username or tabs to complete mentioning -> tribute.isActive flag is set to false and then immediately set to true. Due to this immediate set to true, on every key press the user search endpoint is called with the text after the @.

The issue might be in how we implemented tributejs or could potentially be a problem in TributeJS itself. However, I couldn't find such issues in the TributeJS repository.

Aadesh-Baral avatar Jan 16 '24 10:01 Aadesh-Baral

Hey @Aadesh-Baral, I've made a PR for this issue. Can you verify ?

royallsilwallz avatar Jan 23 '24 06:01 royallsilwallz