Steps to reproduce (some might be redundant):
- Phorge at 03afb97ff20bd5480ecfa0fa809e3b751bd973e8, PHP 8.2.11
- Create a project parent
- Select in the left sidebar
- Leave New Empty Board and selec the Create Workboard button
- See that column Backlog exists
- Select in the upper right corner, select , create additional column foo (might not be needed)
- Select in the left sidebar
- Select in the right sidebar and create milestone jan-mar
- Select in the right sidebar and create milestone apr-jun
- Go to http://phorge.localhost/maniphest/task/edit/form/default/ , set Tags field to parent and create a new task
- In that task, select Add Action... → Change Project Tags and change parent to jan-mar
- In that task, select Add Action... → Change Project Tags and change jan-mar to apr-jun
- Go to the workboard of the parent project and try to drag the task from the apr-jun column to the default Backlog column
Expected outcome:
Task is moved from milestone column to parent project column
Actual outcome:
[2023-10-04 21:34:26] EXCEPTION: (AphrontDuplicateKeyQueryException) #1062: Duplicate entry 'PHID-PROJ-yt43plz2cxlidyu4dlia-PHID-PCOL-no7jbin6vngwkrghrmrk...' for key 'boardPHID' at [<phorge>/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:346] arcanist(head=master, ref.master=35e127da57a8), phorge(head=master, ref.master=03afb97ff20b) #0 <#2> AphrontBaseMySQLDatabaseConnection::throwCommonException(integer, string) called at [<phorge>/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:389] #1 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phorge>/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:321] #2 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phorge>/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:217] #3 <#2> AphrontBaseMySQLDatabaseConnection::executeQuery(PhutilQueryString) called at [<phorge>/src/infrastructure/storage/xsprintf/queryfx.php:8] #4 <#2> queryfx(AphrontMySQLiDatabaseConnection, string, PhutilQueryString, PhabricatorProjectColumnPosition, array, array) called at [<phorge>/src/infrastructure/storage/connection/AphrontDatabaseConnection.php:58] #5 <#2> AphrontDatabaseConnection::query(string, PhutilQueryString, PhabricatorProjectColumnPosition, array, array) called at [<phorge>/src/infrastructure/storage/lisk/LiskDAO.php:1117] #6 <#2> LiskDAO::insertRecordIntoDatabase(string) called at [<phorge>/src/infrastructure/storage/lisk/LiskDAO.php:954] #7 <#2> LiskDAO::insert() called at [<phorge>/src/infrastructure/storage/lisk/LiskDAO.php:923] #8 <#2> LiskDAO::save() called at [<phorge>/src/applications/project/engine/PhabricatorBoardLayoutEngine.php:288] #9 <#2> PhabricatorBoardLayoutEngine::applyPositionUpdates() called at [<phorge>/src/applications/maniphest/editor/ManiphestTransactionEditor.php:756] #10 <#2> ManiphestTransactionEditor::applyBoardMove(ManiphestTask, array) called at [<phorge>/src/applications/maniphest/editor/ManiphestTransactionEditor.php:89] #11 <#2> ManiphestTransactionEditor::applyCustomExternalTransaction(ManiphestTask, ManiphestTransaction) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:841] #12 <#2> PhabricatorApplicationTransactionEditor::applyExternalEffects(ManiphestTask, ManiphestTransaction) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1409] #13 <#2> PhabricatorApplicationTransactionEditor::applyTransactions(ManiphestTask, array) called at [<phorge>/src/applications/project/controller/PhabricatorProjectMoveController.php:140] #14 <#2> PhabricatorProjectMoveController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284] #15 phlog(AphrontDuplicateKeyQueryException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41] #16 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, AphrontDuplicateKeyQueryException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751] #17 AphrontApplicationConfiguration::handleThrowable(AphrontDuplicateKeyQueryException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296] #18 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203] #19 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
Other information:
- Cannot reproduce when using drag&drop on the project workboard instead of using the Add Action... dropdown in the individual task
- Cannot reproduce when moving to a milestone and back to Backlog; Seems to require moving to milestone, moving to another milestone, and back to Backlog
- I could imagine a bug in updateWorkboardColumns() in https://we.phorge.it/source/phorge/browse/master/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php$4915 introduced in rPf97d120c3fe6f560b05e94075fa2bde6c4a07855
- Old upstream: https://secure.phabricator.com/T13271
- Downstream: https://phabricator.wikimedia.org/T139396