Skip to content

fix(api)!: a taken file path is a duplicate, with the field named - #122

Merged
olavgg merged 1 commit into
mainfrom
errors/11-path-taken-is-duplicate
Sep 17, 2026
Merged

olavgg merged 1 commit into
mainfrom
errors/11-path-taken-is-duplicate

Conversation

@JosteinGj

Copy link
Copy Markdown
Contributor

What

  • POST /files/update onto a taken path: the response was the generic conflict. It is now duplicate with fields: [{"field": "path", …}].
  • PUT /files (upload) onto a taken path or externalId: the partial unique index inodes_path_hash_active_uk and the constraint inode_external_id_hash_key were missing from DataIntegrityViolationExceptionHandler's map. The 409 therefore came back as a duplicate with no fields, and the server logged "Unmapped constraint violation". Both are mapped now, so the 409 names path or externalId.
  • Schema: both 409s now point at DuplicateProblem instead of ApiProblem.

Compatibility

  • Update: the type changes from conflict to duplicate.
  • Upload: it was already duplicate and only gains fields.
  • Status and retry: unchanged.

Not verified

A unit test covers the constraint-name map. I have not checked against a real Postgres that Hibernate reports the partial unique index's name on a unique violation (23505). Postgres words it as violates unique constraint "inodes_path_hash_active_uk", which is what the name extractor parses.

Docs (datahub-sdk-docs)

The 409 row in reference/files.md §Upload › When it fails could mention fields.

This is one of four independent problem-type PRs (see #120). They merge cleanly with each other in any order. ./gradlew :datahub-api:test passes.

🤖 Generated with Claude Code

Moving or renaming a file onto a taken path answered the generic conflict,
while an upload onto one hit an unmapped constraint: duplicate, no fields, and
a warning in the log. Both now answer duplicate with `fields` naming path, and
an upload onto a taken externalId names that field too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
@JosteinGj
JosteinGj requested a review from olavgg as a code owner September 17, 2026 09:15
@olavgg
olavgg merged commit 3767091 into main Sep 17, 2026
8 of 9 checks passed
@olavgg
olavgg deleted the errors/11-path-taken-is-duplicate branch September 17, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants