mirror of
https://github.com/iflytek/skillhub.git
synced 2026-09-06 08:15:57 +00:00
Concurrent publishes for the same (namespace_id, slug, owner_id) or (skill_id, version) coordinate both pass the check-then-create reads and race on the database unique constraints. The losing request surfaced an unhandled DataIntegrityViolationException as HTTP 500. Translate the constraint violation at both insert points into a deterministic DomainBadRequestException (error.skill.publish.concurrentConflict), matching the existing idiom in LabelDefinitionService/ReviewService/ PromotionService. No same-transaction re-read is attempted, so the losing publish rolls back cleanly and returns a retryable conflict instead of a 500. Add the i18n key (en/zh) and two unit tests covering the skill-insert and version-insert races. Closes #617 Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| .mvn | ||
| scripts | ||
| skillhub-app | ||
| skillhub-auth | ||
| skillhub-domain | ||
| skillhub-infra | ||
| skillhub-notification | ||
| skillhub-search | ||
| skillhub-storage | ||
| .dockerignore | ||
| Dockerfile | ||
| Dockerfile.dev | ||
| mvnw | ||
| mvnw.cmd | ||
| pom.xml | ||