Skip to content

Tag sidebar index may not update when tag text is edited via bear-replace-text #85

@vasylenko

Description

@vasylenko

Context

A user reported that replacing tag text (#hashtags) inside note bodies via the MCP server did not update Bear's sidebar tag index. The sidebar still showed the old tag after the replacement. The user's Claude session had to access the SQLite database directly to resync the tag records.

What we know

  • The report comes from a single user who was trying to merge and reorganize their tagging system
  • Our bear-replace-text tool uses Bear's add-text x-callback-url action with mode=replace, which updates the note body text (ZSFNOTE.ZTEXT)
  • Bear maintains tags in two places: inline #tag text in the note body, and a separate index table (ZSFNOTETAG + Z_5TAGS junction table)
  • Bear's own editor keeps these in sync — typing a tag in the editor updates the index table
  • We have a dedicated bear-rename-tag tool that uses Bear's rename-tag x-callback-url action, which is designed for global tag renaming and presumably updates both text and index

What we don't know — needs verification

  • Does Bear's add-text mode=replace actually fail to re-index tags from the changed content? This is the core question
  • Is this behavior consistent across Bear versions, or was it a version-specific bug?
  • Does the same issue occur with add-text mode=append or mode=prepend when adding new tag text?
  • Does the user's Bear version matter? (The Reddit thread mentioned Bear beta 2.7)

Reproduction steps (proposed)

  1. Create a note with tag #test-old in the body
  2. Use bear-replace-text to replace the section containing #test-old with text containing #test-new
  3. Check Bear's sidebar: does #test-new appear? Does #test-old disappear?
  4. Query ZSFNOTETAG and Z_5TAGS tables directly to verify index state

Impact

If confirmed, this is a Bear app limitation — not a bug in our code. Mitigation options would be documentation/instructions to guide LLMs, but we should verify before adding any guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-verificationReported behavior needs to be verified before acting on it

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions