fix: localize alignment conflicts by stable error code - #837
Merged
Merged
Conversation
Signed-off-by: dada-yan <BinjunYann@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A human kind-word review can return 409 after its bounded lock wait, but the UI currently labels every 409 as busy. As noted in the review of #828, a second conflict would show the wrong recovery advice.
Add a coded conflict variant alongside the legacy variant, emit
alignment_busyfrom the existing lock-timeout branch, and select the Review message by code. Unknown, uncoded and other conflicts use a localized generic conflict message. The lock, rollback, HTTP status and worker wait policy are unchanged. This follows ADR 0004's existing stable-code localization contract; it does not redesign the error envelope or migrate unrelated callers.Audit: legacy conflicts also represent document lifecycle/duplicates, ontology key/deletion conflicts, entity merges/reverts, governed decisions, duplicate mappings, account registration and RSS generation races. Several ingestion/governance callers match the old variant internally. They remain unchanged for separate domain-specific migrations; no existing match is silently broadened. The only producer of the new variant is the human alignment entry point.
Validation on Linux with required PostgreSQL tests: workspace 958 passed, zero failed, one existing live-HTTPS test ignored; fmt, Clippy with warnings denied and workspace build passed. Frontend 99 tests, style/type checks and production build passed. API error-envelope tests cover a second coded conflict, legacy 409, permissions, validation and redacted 500. The three authenticated contention scenarios now assert the stable code and all existing lock/rollback/pool regressions pass. English/Chinese UI tests vary the message independently of the code and verify unknown-conflict fallback. The first full run on a fresh unmigrated database failed two existing tests; after running migrations, the complete rerun above passed.
No migration. Reverting returns Review to the prior status-only message; clients receiving an unknown code already have a fallback.
Refs #798 and #828 (comment)