Closed shubhamdotjain closed 2 years ago
Summarizing what Fam said on the mailing list, if the message already exists, the /api/v1/messages
endpoint must report the existing URI, as long as the user has permissions to import it. For /api/v1/projects/NN/messages
it should fail instead.
Fixed in commit 77150db46bb308bab579349792099463d5a0fbf0.
On importing a message which is already imported before, the REST would give error UNIQUE constraint failed: api_message.project_id, api_message.message_id. This breaks scripts/patchew-impoter. Upon network error, the importer instance is restarted and will retry the import. The server may already received the message but just failed to return to patchew-cli, in this case, an empty project_list makes more sense than error.