Skip to content

Show the existing properties when a suggested property conflicts #128

Open

Description

@disconsented

This issue was written by an AI assistant (Claude) from a conversation with the maintainer. Check the details before you act on them.

Problem

When a user suggests a property and the server rejects it as a conflict, the user does not see which property caused the conflict. PropertiesError::Conflict (src/domain/properties.rs) has no data, and the web layer returns only a 409 with the brief "Conflict". The UI (conflict snippet in ui/src/routes/app/[id]/[[slug]]/suggestProperty.svelte) shows only the value that the user typed: "already exists on this item (or is too close to an existing item). Upvote it". "Upvote it" is underlined text, not a link or a button.

Causes of a conflict

src/db/properties_repository.rs returns Conflict in 3 places:

  1. Similarity. The query finds values in the same class with normalized_damerau_levenshtein > 0.8. It searches the global properties table, not only the properties of this item. Thus a user can get a conflict with a property that is not on this item. The similar_properties list is available here, but the code only writes it to a debug log.
  2. Exact duplicate. The same class and value is already linked to this item.
  3. Race. The unique index rejects the RELATE.

Proposed change

  • Change PropertiesError::Conflict to hold the conflicting properties, for example Conflict { existing: Vec<Property> }. Fill it from similar_properties for cause 1 and with test_prop for causes 2 and 3.
  • Return the list in the 409 response body as external types, not RecordId values. Add it to the OpenAPI schema.
  • In suggestProperty.svelte, list each conflicting property. If the property is on this item, give a vote button. If it is not on this item, let the user suggest that value instead of the value they typed.
  • Change the message so that it does not say "on this item" when the match came from the global table.

Other callers that match PropertiesError::Conflict (src/db/properties_actor.rs, src/processing/ml_queue_actor.rs, src/web/properties.rs) must change to Conflict { .. }.

Question

Is cause 1 intended to search all items? If so, the system rejects a new value for an item when a similar value exists on any item of the same class. That is a canonicalisation rule, so the UI must show the canonical value to the user. If not, the query must be limited to the properties of this item.

Activity

  1. added
    enhancement
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions