feat: Enhance task and reward assignment logic to prioritize user items over system items with the same name; add corresponding tests
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 15s
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 15s
This commit is contained in:
19
.github/specs/archive/bug-both-system-and-user-items-shown.md
vendored
Normal file
19
.github/specs/archive/bug-both-system-and-user-items-shown.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Bug: When a user task or reward exists with the same name as a system user or task, both are shown in the assign list.
|
||||
|
||||
## The Problem
|
||||
|
||||
- **Actual:** When the user creates a task/reward from a system task/reward (copy on edit), and then goes to assign the task/reward, both the system and user task/reward are shown and can be assigned.
|
||||
- **Expected:** When a user task/reward is created from a system (or even if it has the same name) - show the user item instead in the assign views.
|
||||
|
||||
## Investigation Notes
|
||||
|
||||
- When a copy on edit happens of a 'good' task and it is changed to 'bad', I can see the 'good' task when assigning tasks and the 'bad' penalty when assigning the penalty
|
||||
- The backend will have to change to probably check if the names are the same on tasks/rewards and if so, choose to return the user items instead.
|
||||
- In the case of two items having the same name AND having different user_ids that are not null, then we should show both items.
|
||||
- The task view and reward view correctly hides the system item. However, the Task Assign View and RewardAssignView are still showing both items.
|
||||
|
||||
## The "Red" Tests
|
||||
|
||||
- [x] Create a test that performs a copy on edit and then makes sure only that item shows instead of the system item
|
||||
- [x] Create a test that performs has 2 user items with the same name as a system item. Verify that the user items are shown, but not the system item.
|
||||
- [x] Create a test where if a system and identically named user task exist that the user tasks is the only one shown in the task assign view and reward assign view.
|
||||
Reference in New Issue
Block a user