Time tracking quick action add wrong value
Summary
When entering /spend 5h30
(note the missing m
at the end), my Gitlab instance (v16.9.1) adds 4d 3h to the time log:
On Gitlab.com, it adds 35h instead:
Steps to reproduce
- Go to an issue
- Enter
/spend 5h30
into the comment field - Hit "Comment", or press Ctrl+Enter
Example Project
https://gitlab.com/dmke/simple-password-gen/-/issues/7
Request
POST https://gitlab.com/dmke/simple-password-gen/notes?target_id=70410498&target_type=issue
Request body (formatted):
{
"note": {
"noteable_type": "Issue",
"noteable_id": 70410498,
"internal": false,
"note": "/spend 5h30"
}
}
Response body (formatted):
{
"commands_changes": {
"spend_time": {
"duration": 126000,
"user_id": 1281642,
"spent_at": "2024-03-01T16:18:30.533+00:00",
"category": null,
"note_id": null
}
},
"command_names": ["spend"],
"valid": false,
"errors": {
"commands_only": ["Added 35h spent time."],
"command_names": [["spend"]]
}
}
N.B.: valid=false??
What is the current bug behavior?
Missing units are interpreted wrong, and no error is displayed.
What is the expected correct behavior?
Either interpret missing units in a more intuitive way (last unit was hour, next shall be minute), or display an error.
One solution could be to remember the last unit encountered (i.e. hour in 5h30
), and assume the next smaller unit, should one be missing (i.e. hour → minute).
Relevant logs and/or screenshots
See above.
Output of checks
Results of GitLab environment info
n/a
Results of GitLab application Check
n/a
Possible fixes
n/a