fix(cv-qa): protect import lifecycle races and terminal receipts

This commit is contained in:
cesnimda
2026-10-27 00:27:57 +01:00
parent cf0e5c23de
commit 89974a257e
8 changed files with 250 additions and 11 deletions
@@ -239,6 +239,8 @@ public sealed partial class ProfileCvController
}, HttpContext.RequestAborted);
}
catch (DbUpdateConcurrencyException) { return Conflict(new { code = "revision_conflict", message = "The career profile changed. Refresh the comparison and review your decisions." }); }
// MariaDB can report a changed run as a snapshot conflict before EF sees zero affected rows.
catch (DbUpdateException ex) when (ex.InnerException is MySqlConnector.MySqlException { Number: 1020 }) { return Conflict(new { code = "revision_conflict", message = "The import changed. Refresh the comparison and review your decisions." }); }
catch (ArgumentException ex) { return BadRequest(ex.Message); }
catch (CareerProjectionException ex) { return BadRequest(ex.Message); }
}