Skip to content

[Bug]: Draft note links are silently dropped on publish (entity_type casing mismatch) #222

Closed

Description

@camerontarget14

Describe the bug

Links added to a draft note — manually or via a QC suggestion — never make it to ShotGrid. In publish-notes (backend/src/main.py:1142), each link is resolved with ENTITY_MODELS.get(link.entity_type), but ENTITY_MODELS is keyed lowercase ("shot", "version", …) while links store the capitalized type copied from /search results ("Shot"), so the lookup returns None and the link is skipped with no error or log. The published note only gets the links the provider adds itself (version, parent shot, playlist). Pre-existing since #66; reproduced on main and #221. Fix is a one-liner — normalise with .lower() (or key ENTITY_MODELS by the canonical type) — plus a test that a draft with a Shot link produces that link in note_links. Related: to/cc are also never published (to_users=[] # TODO on the same endpoint), which could be fixed in the same pass.

Steps to reproduce

  1. Stand the app up
  2. try make changes to links
  3. see that they don't publish to SG.

Expected behavior

Link changes publish to SG

Actual behavior

Link changes don't publish to SG

Version or commit

#66 Notes Publish

Activity

  1. added 2 commits that reference this issue on Oct 8, 2026
    ac19e49
    e268419
  2. added a commit that references this issue on Oct 9, 2026
    aad814e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions