Skip to content

Support string ids - #221

Merged
jspada200 merged 15 commits into
AcademySoftwareFoundation:mainfrom
jspada200:support-string-ids
Oct 11, 2026
Merged

jspada200 merged 15 commits into
AcademySoftwareFoundation:mainfrom
jspada200:support-string-ids

Conversation

@jspada200

@jspada200 jspada200 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This is a large refactor the changes the datatype of IDs within DNA.

Reason

When we first started DNA, we used Shotgrid as our main driver to structure the production data in the app. As a result ints were used as the IDs. As other PT providers have shown interest, we see that the int does not have the flexability to allow for support. Ftrack and Ayon both use strings for the IDs.

Approch

I used cursor to reactor the Datatype for IDs. In the shotgrid provider we handle the conversion of strings to ints and back. In addition, the frontend now protects the ID passing via URL by encoding the IDs.

Other change

To make switching testing setups quickly, I updated bootstrap.sh to allow you to change single settings instead of reiniting all the settings.

2026-10-08 07 56 55

Testing

  • I have tested these changes locally
  • I have run all relevant automated tests
  • I have verified this does not break existing workflows
  • For changes that can be tested in UI, I have included screenshots or gif animations of the changes.

How I Tested

To test, I used the app both with the mock and shotgrid provider. All the features seem to be working.

cursoragent and others added 9 commits April 23, 2026 21:22
…ation#92)

Move the default AI note prompt out of Python source into
dna/config/default_note_prompt.yaml, with optional override via
DNA_DEFAULT_NOTE_PROMPT_PATH. User settings GET/PUT now return
default_note_prompt alongside note_prompt; empty note_prompt means
use the deployment default. Settings UI shows the default when the
user has no custom prompt and avoids persisting an unchanged default.

Tests: wrap App tests with ThemeModeProvider; align useDraftNote
expectations with attachmentIds.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: James Spadafora <spadjv@gmail.com>
…or (#2)

TipTap prose used font-weight 600 for strong (same as headings) with no
em styles. Use 700 + explicit primary color for bold, secondary color for
italic, and combined rules for bold+italic so emphasis reads clearly in
light and dark themes.

Fixes AcademySoftwareFoundation#128

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Signed-off-by: James Spadafora <spadjv@gmail.com>
Made-with: Cursor
Signed-off-by: James Spadafora <spadjv@gmail.com>
Made-with: Cursor
…rating while saving the prompt

Signed-off-by: James Spadafora <spadjv@gmail.com>
Signed-off-by: James Spadafora <spadjv@gmail.com>
feat: configurable default note prompt and settings display (AcademySoftwareFoundation#92)
Signed-off-by: James Spadafora <spadjv@gmail.com>
Keep production-tracking entity IDs as strings while bringing in the latest main.

Signed-off-by: James Spadafora <spadjv@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@jspada200
jspada200 requested review from camerontarget14, loorthu and richardssam and removed request for camerontarget14 October 8, 2026 15:25
@jspada200 jspada200 self-assigned this Oct 8, 2026
@jspada200 jspada200 added enhancement New feature or request Backend Work Associated with the backend Frontend Frontend Work Current Prio A Current Priority Complex Task labels Oct 8, 2026
@jspada200 jspada200 added this to the V1 milestone Oct 8, 2026
@jspada200 jspada200 linked an issue Oct 8, 2026 that may be closed by this pull request
Signed-off-by: James Spadafora <spadjv@gmail.com>
…bootstrap script

Signed-off-by: James Spadafora <spadjv@gmail.com>
Signed-off-by: James Spadafora <spadjv@gmail.com>
@jspada200 jspada200 changed the title Draft: Support string ids Support string ids Oct 8, 2026
@jspada200
jspada200 requested a review from Srijan9211 October 8, 2026 17:02
@richardssam

Copy link
Copy Markdown
Collaborator

Is it worth having a validation function per provider per key type? Something to ensure the strings dont get crazy long, or that a number is still a positive number, etc.

@jspada200

Copy link
Copy Markdown
Collaborator Author

Is it worth having a validation function per provider per key type? Something to ensure the strings dont get crazy long, or that a number is still a positive number, etc.

We never really set IDs, we get them from the prodtrack provider or vexa. The one exception is the draft notes we store in mongo.

@camerontarget14 camerontarget14 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled it down and ran it against mock + our SG site — notes/drafts/QC/publish all work, backend tests green at 90%. Couple of things I caught with Claude:

frontend/packages/app/src/qc/noteQcPatch.ts:74 (and same at :82)
still Number() here — backend wants a string now, and this is NaN for ftrack/AYON ids

frontend/packages/app/src/hooks/useNoteQCChecks.ts:18
Number(d.version_id) in the cache key — with UUIDs this collapses every draft to the same key (NaN)

backend/src/dna/storage_providers/mongodb.py:107 (_build_query)
no coercion here means existing docs with int playlist_id/version_id stop matching — mauye we just do a PSA “fresh DB required”? Will wipe anything SPI is working on...

frontend/packages/app/src/components/ChangePlaylistInput.tsx:12
currentPlaylistId?: number — Sidebar passes a string now; the !== at line 198 works by accident

frontend/packages/app/src/components/AddVersionInput.tsx:13
projectId?: number and existingVersionIds: number[] should both be string now


"Typecheck went from 16 errors to 39. The frontend tests are the same 19 failures as main (that ThemeContext localStorage thing, unrelated), but npm run typecheck picks up 23 new ones from this branch. Most are props still typed number while callers now pass strings — works at runtime today but it’s exactly the kind of thing this PR is supposed to kill. Production files: AddVersionInput.projectId, ChangePlaylistInput.currentPlaylistId, VersionStatusRow.projectId in PublishNotesDialog, useProdtrackTabSync.versionId, applyPendingVersionStatus in useDraftNote, useSegments, noteQcPatch. Plus ~8 test files still using numeric fixtures. Worth noting CI doesn’t catch this because the Dockerfile runs vite build without tsc."

Side note: while testing I found that QC-suggested links never reach ShotGrid but that’s a pre-existing bug on main (ENTITY_MODELS is keyed lowercase, links come in as "Shot"), not this PR. Opening a separate issue for it.

Resolve conflicts with AcademySoftwareFoundation#223 (draft note links on publish): adopt the
new _draft_note_links/_add_context_links helpers and update_note links
support, adapted to string IDs (SCRATCH_VERSION_ID sentinel, _to_sg_id
at the ShotGrid boundary). Tests from AcademySoftwareFoundation#223 updated to string fixtures.

Signed-off-by: Cameron Target <camerontarget@gmail.com>
No code changes; formatting only, so the follow-up commit stays readable.

Signed-off-by: Cameron Target <camerontarget@gmail.com>
Props and refs still typed number while callers now pass strings:
AddVersionInput.projectId/existingVersionIds, ChangePlaylistInput
.currentPlaylistId, VersionStatusRow.projectId, useProdtrackTabSync
.versionId and its lastVersionIdRef, applyPendingVersionStatus in
useDraftNote, the segments queryKey cast in useSegments.

Remove the last Number() coercions: noteQcPatch link entity_id (the
backend rejects ints, and UUIDs became NaN) and the useNoteQCChecks
fingerprint (UUIDs collapsed every draft onto one key).

validateActivationPayload still required a numeric playlistId, so the
extension transcription route would always report invalid_payload;
it now checks for a non-empty string.

Test fixtures updated to string IDs; drops a duplicate attachment_ids
key in useDraftNote.test.tsx. npm run typecheck is back to the errors
already present on main; no new test failures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Cameron Target <camerontarget@gmail.com>
@camerontarget14
camerontarget14 self-requested a review October 9, 2026 22:13

@camerontarget14 camerontarget14 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK now it's just the database reset question. I reckon we just PSA to SPI. -- Otherwise, LGTM!

@jspada200
jspada200 merged commit 8c17bc9 into AcademySoftwareFoundation:main Oct 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend Work Associated with the backend Complex Task Current Prio A Current Priority enhancement New feature or request Frontend Frontend Work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert data type for IDs from Ints to Strings

4 participants