[TASKMGMT-55] Users are notified on tasks not belonging to them Created: 14/Oct/21  Updated: 20/Oct/22  Resolved: 06/Oct/22

Status: Closed
Project: Task Management
Component/s: None
Affects Version/s: 1.2.8, 1.2.9
Fix Version/s: 1.2.10, 2.0.0

Type: Bug Priority: Neutral
Reporter: Viet Nguyen Assignee: Nguyen Phung Chi
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 1d 5h Time Spent: 1d 5h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: File TASKMGMT-55-Issue.mp4     PNG File image-2.png    
Issue Links:
Problem/Incident
causality
duplicate
is duplicated by MGNLUI-6917 Users are notified on tasks not belon... Closed
relation
is related to MGNLUI-6341 Notifications show in wrong tabs and ... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
TASKMGMT-61 Implementation Sub-task Completed Nguyen Phung Chi  
TASKMGMT-62 Review Sub-task Completed Evzen Fochr  
TASKMGMT-63 PiQA Sub-task Completed  
TASKMGMT-64 Final QA Sub-task Completed Nguyen Phung Chi  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Task Manager improvements
Sprint: AdminX 20
Story Points: 1
Team: AdminX

 Description   

Steps to reproduce

  1. Login to superuser and publish a page, set the publication date in the future (maybe tomorrow) to trigger scheduled pending publication
  2.  Still in the session, open the task, click on "assign to me", then "approve and publish"
  3. This will create a scheduled task and wait for its publication. Left it there and switch to editor account
  4. Login to editor account such as demo "eric" one to see the issue

Expected results

  • Because the scheduled to be published task has no relation to "eric" editor, he should see no tasks in his pending list as well as total task count

Actual results

  • There is +1 task in the total task count, see below illustration image:

Workaround

  • No

Development notes

  • Investigation shown that the query in info.magnolia.task.persistence.TasksStoreImpl.findTasksByAssigneeAndStatus(String, List<Status>) is not correct.
  • Let's take "eric" editor as an example, we have below query:
    SELECT * FROM [mgnl:task] WHERE (actorId = 'eric' OR actorIds = 'eric') 
    AND status LIKE '%InProgress%' OR status LIKE '%Scheduled%'
    
  • The query list out "Scheduled" tasks that not belong to the editor
  • The fix could be:
    SELECT * FROM [mgnl:task] WHERE (actorId = 'eric' OR actorIds = 'eric') 
    AND (status LIKE '%InProgress%' OR status LIKE '%Scheduled%')
    

Discovery

  • The issue is reproduce-able (check the screen recording in attachment)  and the proposed solution above seems legit too.

Generated at Mon Feb 12 11:02:39 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.