reference creatortrack social sync raw json overwrite bug 20260715T162647
name: CreatorTrack social page-open re-sync was silently wiping stored video extraction data
description: Fixed bug (commit fe89ba2): visiting a workspace's Social page re-synced recent videos and replaced each row's raw JSON wholesale, destroying Task 13's extraction output stored at raw.structure, causing quiet re-extraction and repeat paid model calls.
type: reference
Root cause chain: every open of the Social page triggers a re-sync of the most recent ~50 videos; that sync path replaced each social_videos row's raw JSON column wholesale rather than merging; the video-structure extraction feature (Task 13) stores its output at raw.structure; a wholesale replace erased it, making the extractor think those videos were never processed, so it silently re-ran (paid) model calls on them every time the page was viewed. Fixed by carrying the old row's structure field over into every fresh sync payload, the same preservation contract already used for the transcript columns.
Why: this was a slow, silent money leak that would have compounded once the daily sync timer went live at ship, and it wasn't caught by normal test runs because the page looked correct (data just quietly re-generated in the background).
How to apply: any future column on app.social_videos (or similar sync-then-derive tables) that stores derived/extracted data inside a JSON blob that gets periodically re-synced from an external API needs an explicit merge/preserve step in the upsert, not a wholesale overwrite. Worth checking for the same pattern before adding new derived-data fields to synced tables.
[auto-memory session 60d132de-4659-485c-8044-427af0ccce7f, confidence 0.75, mode staged]