Handle informative messages for executed quick action in errors field
What does this MR do and why?
When a new note (aka comment) for work items only contains quick actions, the backend tries to relay additional information to users.
Example: suppose you created a new note with the content /assign @someone
.
No new note would actually be created as the note functionality used as a delivery vehicle to execute the assign quick action.
After executing the quick action successfully, the backend helpfully tries to inform the user with the message "Commands only assigned @someone"
.
Unfortunately, if you submitted a new note through GraphQL using createNote
mutation, you would see the message included in errors
field.
GraphQL mutation | GraphQL mutation response |
---|---|
Since an error would be detected, the frontend currently does not refresh the comment form even though the error wasn't real.
To fix the issue, we will conditionally ignore errors
if the first error message contains the string Commands only
and there are two error messages contained in the field. It's not a clean fix but we will have to cope with it until we can figure out a more fundamental solution from the backend.
In #391281, we will iterate on the current solution and try to surface the ignored errors as helpful messages via an alert.
How to set up and validate locally
- Grab some issue and note its URL.
Ex. http://127.0.0.1:3000/gitlab-org/gitlab-test/-/issues/38
- By changing
issues
towork_items
, you can view the issue through the Work Items interfaces.
Ex. http://127.0.0.1:3000/gitlab-org/gitlab-test/-/work_items/38
- Click "Add a reply" and use a quick action as shown in the demo video. Observe that the form is successfully cleared.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #391282 (closed)