tasking-manager
tasking-manager copied to clipboard
Error 404 when comment using mention i.e. @[user]
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.
To Reproduce Steps to reproduce the behavior:
- Go to project page
- Select task to map or validate
- Comment on the task by mentioning
- See error on in network tab
Screenshots
Additional context The error doesn't disturb on the workflow i.e. user will be able to perform/submit mapping and validation.
@ramyaragupathy working on this issue
Hey @Aadesh-Baral, when are you planning to look into this issue? Did you find anything yet?
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.
Hey @Aadesh-Baral, I've made a PR for this issue. Can you verify ?