anyproto / anyproto/anytype-api

"type key of bundled types cannot be changed" for custom type

Open
#11 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

Hello, maybe it is not a bug, but I can't update type_key (current type_key is "book") for my custom type with error:
{"status":400,"object":"error","code":"bad_request","message":"bad input: type key of bundled types cannot be changed"}
Same error when I am trying to update System type, but it is not a system type.

And also I can't get any object by this type, but type exist and objects exist:
Request:
{
limit: 1,
types: [
book
],
space_id: space_id
}
always response: {"data":[],"pagination":{"total":0,"offset":0,"limit":1,"has_more":false}}

Expected Behavior

I can update type_key and can get objects by this type.

Steps To Reproduce
  1. request to change type_key "book"

  2. fail

  3. get object by type_key "book"

  4. no objects even if they exist

I am not sure that it is reproducible, for me it is only one type for now, but maybe someone else will catch same error. I guess the solution is just create new type and move all object to new type, but maybe it is better to understand problem and fix it.

Environment
- OS: macos 15+
- Version: 0.49.2
Anything else?

I am open to provide additional information, if reqired

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 type_key update for "book" and the object query using types and space_id against version 0.49.2. Trace the API entry points handling bundled or system type checks and type-filtered object retrieval; done means custom types can be renamed and their existing objects are returned by type_key.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.