{"record":{"id":"4af5037338a76e51","repo":"odysseus-dev/odysseus","slug":"unsupported-cleanup-action","errorCode":null,"errorMessage":"Unsupported cleanup action","messagePattern":"Unsupported cleanup action","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/email_routes.py","lineNumber":2685,"sourceCode":"                \"method\": method,\n                \"candidate\": candidate,\n                \"moved_to_spam\": moved,\n            }\n        except ValueError as e:\n            return {\"success\": False, \"error\": str(e)}\n        except Exception as e:\n            logger.error(f\"unsubscribe execute failed uid={uid}: {e}\")\n            return {\"success\": False, \"error\": \"Mail operation failed\"}\n\n    @router.post(\"/unsubscribe/cleanup\")\n    def cleanup_unsubscribe_candidates(data: dict, owner: str = Depends(require_owner)):\n        \"\"\"Move reviewed unsubscribe candidate messages to Junk or Trash.\"\"\"\n        folder = str((data or {}).get(\"folder\") or \"INBOX\").strip() or \"INBOX\"\n        account_id = (data or {}).get(\"account_id\") or None\n        action = str((data or {}).get(\"action\") or \"\").strip().lower()\n        raw_uids = (data or {}).get(\"uids\") or []\n        if action not in {\"junk\", \"delete\"}:\n            raise HTTPException(400, \"Unsupported cleanup action\")\n        if account_id:\n            _assert_owns_account(account_id, owner)\n        uids: list[str] = []\n        seen = set()\n        for raw_uid in raw_uids:\n            uid = str(raw_uid or \"\").strip()\n            if not uid or uid in seen:\n                continue\n            if not uid.isdigit():\n                continue\n            seen.add(uid)\n            uids.append(uid)\n        if not uids:\n            return {\"success\": False, \"error\": \"No email UIDs provided\", \"changed\": 0, \"failed\": 0}\n        role = \"junk\" if action == \"junk\" else \"trash\"\n        target = \"Junk\" if action == \"junk\" else \"Trash\"\n        changed = 0\n        failed = 0","sourceCodeStart":2667,"sourceCodeEnd":2703,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/email_routes.py#L2667-L2703","documentation":"Error \"Unsupported cleanup action\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Use one of the supported cleanup actions listed in the email cleanup UI.","Check the request payload for a typo in the action name."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}