anyproto / anyproto/anytype-api

multi_select write rejects valid tag returned by list_tags for custom property

Open
#67 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
113
Forks
20
Avg merge
16m
Merged PRs (30d)
1

Description

Have you read a contributing guide?
  • I have read CONTRIBUTING.md
  • I have searched the existing issues and didn't find any that were similar
  • I have considered creating a pull request with fixes instead of a bug report and want to proceed
Current Behavior

When updating an object and assigning a value to a custom multi_select property, the API rejects the option as invalid, even though the same
option is returned by list_tags for that exact property.

I tested both:

  • the tag id
  • the tag key

Both are rejected.

Error returned by update-object:

   {
    "status": 400,
    "object": "error",
    "code": "bad_request",
    "message": "bad input: invalid multi_select option for \"genero\": bafyreibv3xab76u37lhzr7il2vm2li226jq3ywfkfxum3fvqstngk4s3ke"
  }
Additional Context

This looks like a read/write inconsistency:

  • list_tags says the tag belongs to the property
  • update-object rejects the same tag for that property

I also noticed duplicate-looking entries in this property's tag list, for example two separate tags with key/name related to novela, which may
indicate an internal indexing or metadata inconsistency for custom multi-select properties.

Documentation References
Expected Behavior

If list_tags returns a tag as belonging to property genero, that tag should be accepted by object create/update requests for that property.

According to the current API documentation, multi_select should accept tag keys or tag IDs.

Steps To Reproduce
  1. Use a space with a custom multi_select property named genero
  2. Call list_tags for that property
  3. Take one returned tag from the response
  4. Try to update an object with that tag as the value for genero
Reproduction Data
Space
  {
    "space_id": "bafyreih3tia7jxd6who2tqczxxrqy7wupxr2buk33edhsyrrzjakaxqlaa.9ldhqwv21s5z"
  }
Property
  {
    "property_id": "bafyreih7scpbieixek72dtd763glky2665ezu4v6jo3eqt5h62tnycnneu",
    "property_key": "genero"
  }
Object being updated
  {
    "object_id": "bafyreicj7mcbphf52wpfiu5f7oh4jex6daosfll6jxi3tupfmiujldfrny"
  }
list_tags request
  {
    "property_id": "bafyreih7scpbieixek72dtd763glky2665ezu4v6jo3eqt5h62tnycnneu",
    "space_id": "bafyreih3tia7jxd6who2tqczxxrqy7wupxr2buk33edhsyrrzjakaxqlaa.9ldhqwv21s5z"
  }
list_tags response except
  {
    "data": [
      {
        "object": "tag",
        "id": "bafyreibv3xab76u37lhzr7il2vm2li226jq3ywfkfxum3fvqstngk4s3ke",
        "key": "clasico",
        "name": "Clásico",
        "color": "purple"
      }
    ]
  }
Update request using tag ID
  {
    "object_id": "bafyreicj7mcbphf52wpfiu5f7oh4jex6daosfll6jxi3tupfmiujldfrny",
    "space_id": "bafyreih3tia7jxd6who2tqczxxrqy7wupxr2buk33edhsyrrzjakaxqlaa.9ldhqwv21s5z",
    "properties": [
      {
        "key": "genero",
        "multi_select": [
          "bafyreibv3xab76u37lhzr7il2vm2li226jq3ywfkfxum3fvqstngk4s3ke"
        ]
      }
    ]
  }
Update request using tag key
  {
    "object_id": "bafyreicj7mcbphf52wpfiu5f7oh4jex6daosfll6jxi3tupfmiujldfrny",
    "space_id": "bafyreih3tia7jxd6who2tqczxxrqy7wupxr2buk33edhsyrrzjakaxqlaa.9ldhqwv21s5z",
    "properties": [
      {
        "key": "genero",
        "multi_select": [
          "clasico"
        ]
      }
    ]
  }

Both requests fail with a validation error saying the multi_select option is invalid.

Environment
- OS: Debian
- Version: 13
Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the mismatch through the list_tags and update-object API entry points using the supplied property, object, and tag data. Trace where multi_select values are resolved and validated, then verify that a tag returned by list_tags is accepted by both ID and key; add or run the relevant API validation tests if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.