{"record":{"id":"b0abdbdb72ebd30e","repo":"phacility/phabricator","slug":"invalid-mode-s","errorCode":null,"errorMessage":"Invalid mode \"%s\".","messagePattern":"Invalid mode \"(.+?)\"\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/conduit/DiffusionUpdateCoverageConduitAPIMethod.php","lineNumber":103,"sourceCode":"    $conn->openTransaction();\n    $mode = $request->getValue('mode');\n      switch ($mode) {\n        case '':\n        case 'overwrite':\n          // sets the coverage for the whole branch, deleting all previous\n          // coverage information\n          queryfx(\n            $conn,\n            'DELETE FROM %T WHERE branchID = %d',\n            $table_name,\n            $branch->getID());\n          break;\n        case 'update':\n          // sets the coverage for the provided files on the specified commit\n          break;\n        default:\n          $conn->killTransaction();\n          throw new Exception(pht('Invalid mode \"%s\".', $mode));\n      }\n\n      foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) {\n        queryfx(\n          $conn,\n          'INSERT INTO %T (branchID, pathID, commitID, coverage) VALUES %LQ'.\n          ' ON DUPLICATE KEY UPDATE coverage = VALUES(coverage)',\n          $table_name,\n          $chunk);\n      }\n    $conn->saveTransaction();\n  }\n\n}\n","sourceCodeStart":85,"sourceCodeEnd":118,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/conduit/DiffusionUpdateCoverageConduitAPIMethod.php#L85-L118","documentation":"Enum guard in DiffusionUpdateCoverageConduitAPIMethod::execute: the 'mode' parameter of the coverage update did not match any of the switch cases ('' / 'overwrite' to replace all branch coverage, or 'update' to merge per-file coverage) and hit the default branch, which kills the open transaction before throwing. The supplied mode string is simply not one of the two supported coverage-write modes.","triggerScenarios":"Thrown at src/applications/diffusion/conduit/DiffusionUpdateCoverageConduitAPIMethod.php:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass mode as 'overwrite' (replace the branch's coverage) or 'update' (merge the provided files), or omit it entirely for the default overwrite behavior","Check for typos or case differences in the mode value sent by the coverage tooling","Upgrade the client tooling if it sends a mode value from a different API version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}