Page MenuHomePhorge

Moving tasks on a workboard via the "Add Action" dropdown does not update column and column positions tables
Open, Needs TriagePublic

Description

<tl:dr>: When using the "Add Action" dropdown in a task to move a task from a parent project into a milestone of the parent project, both phabricator_project.project_columnposition.columnPHID and phabricator_project.project_column.proxyPHID do not get updated. They do get correctly updated when drag-n-drop'ing on the workboard instead.


This behavior is the root cause of both T15650: AphrontDuplicateKeyQueryException dragging task from milestone column to main board column: Duplicate entry for key 'boardPHID' and One Phabricator task displayed in two workboard columns simultaneously (which turned out to be an upstream issue too).

Steps to reproduce:

  1. Phorge at 9ebe85621919390a3e4daa56706993f203e02b2e
  2. Set up a workboard with two "standard" columns and two "milestone" project columns.
  3. Add a task to that project:

Screenshot from 2024-03-28 20-14-39.png (306×1 px, 57 KB)

  1. Look at the DB:
MariaDB [phabricator_project]> select pc.name AS columnName, pc.proxyPHID, pcp.* from project_columnposition pcp INNER JOIN project_column pc ON pc.phid=pcp.columnPHID INNER JOIN project p ON p.phid = pcp.boardPHID WHERE pcp.objectPHID = "PHID-TASK-f6ri2kdpcvtb3yncho2n";
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
| columnName | proxyPHID | id  | boardPHID                      | columnPHID                     | objectPHID                     | sequence |
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
| Backloggg  | NULL      | 647 | PHID-PROJ-yt43plz2cxlidyu4dlia | PHID-PCOL-no7jbin6vngwkrghrmrk | PHID-TASK-f6ri2kdpcvtb3yncho2n |        0 |
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
1 row in set (0.001 sec)
  1. Open the task, open the "Add Action..." dropdown, select "Change Project tags", enter the first milestone project, click "Submit".
  2. Workboard view is correctly updated, however see that there are no changes in the DB: No proxyPHID gets set, and the columnPHID does not get updated. Thus it is the same DB output as in step 4.
  3. On the workboard, drag the task from the first milestone project to the second "normal" column:

Screenshot from 2024-03-28 20-38-02.png (306×1 px, 61 KB)

  1. Look at the DB: Bug: Two entries instead of one:
MariaDB [phabricator_project]> select pc.name AS columnName, pc.proxyPHID, pcp.* from project_columnposition pcp INNER JOIN project_column pc ON pc.phid=pcp.columnPHID INNER JOIN project p ON p.phid = pcp.boardPHID WHERE pcp.objectPHID = "PHID-TASK-f6ri2kdpcvtb3yncho2n";
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
| columnName | proxyPHID | id  | boardPHID                      | columnPHID                     | objectPHID                     | sequence |
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
| Backloggg  | NULL      | 647 | PHID-PROJ-yt43plz2cxlidyu4dlia | PHID-PCOL-no7jbin6vngwkrghrmrk | PHID-TASK-f6ri2kdpcvtb3yncho2n |        0 |
| foo        | NULL      | 648 | PHID-PROJ-yt43plz2cxlidyu4dlia | PHID-PCOL-wosrj57qdnhq6r6ih2rl | PHID-TASK-f6ri2kdpcvtb3yncho2n |        0 |
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
2 rows in set (0.001 sec)

Expected behavior, for comparison:

  1. On the workboard, drag the task from the default "normal" column to the first milestone project.
  2. Workboard view is correctly updated, and now there are changes in the DB - proxyPHID is set as excepted:
MariaDB [phabricator_project]> select pc.name AS columnName, pc.proxyPHID, pcp.* from project_columnposition pcp INNER JOIN project_column pc ON pc.phid=pcp.columnPHID INNER JOIN project p ON p.phid = pcp.boardPHID WHERE pcp.objectPHID = "PHID-TASK-f6ri2kdpcvtb3yncho2n";
+------------+--------------------------------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
| columnName | proxyPHID                      | id  | boardPHID                      | columnPHID                     | objectPHID                     | sequence |
+------------+--------------------------------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
|            | PHID-PROJ-ydpkvhq7hv3zq4d7nnu5 | 650 | PHID-PROJ-yt43plz2cxlidyu4dlia | PHID-PCOL-ekr4zowjecvxiwcfrwbr | PHID-TASK-f6ri2kdpcvtb3yncho2n |        0 |
+------------+--------------------------------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
1 row in set (0.001 sec)
  1. On the workboard, drag the task from the first milestone project to the second "normal" column. Only one task card is shown as expected, and the DB is also updated correctly as expected:
MariaDB [phabricator_project]> select pc.name AS columnName, pc.proxyPHID, pcp.* from project_columnposition pcp INNER JOIN project_column pc ON pc.phid=pcp.columnPHID INNER JOIN project p ON p.phid = pcp.boardPHID WHERE pcp.objectPHID = "PHID-TASK-f6ri2kdpcvtb3yncho2n";
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
| columnName | proxyPHID | id  | boardPHID                      | columnPHID                     | objectPHID                     | sequence |
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
| foo        | NULL      | 651 | PHID-PROJ-yt43plz2cxlidyu4dlia | PHID-PCOL-wosrj57qdnhq6r6ih2rl | PHID-TASK-f6ri2kdpcvtb3yncho2n |        0 |
+------------+-----------+-----+--------------------------------+--------------------------------+--------------------------------+----------+
1 row in set (0.001 sec)