Reference creatortrack social raw json extraction wipe bug
URL: https://mkdocs.justinsforge.com/memory/general/reference_creatortrack_social_raw_json_extraction_wipe_bug/
Found and fixed 2026-07-15 (commit fe89ba2, main branch social ingest work). Every Social page open in CreatorTrack re-syncs the most recent 50 videos, and that sync wholesale-replaced each row's raw JSON column with a fresh payload from the platform API. The video-structure extractor stores its derived output at raw.structure inside that same column. Because the resync overwrote the whole column, raw.structure vanished on every visit to the page, the extractor then saw those videos as never-extracted and quietly re-ran (paid) model calls on them again.
Why: any code path that upserts a "raw API payload" JSON column needs to know whether other features stash derived/computed data inside that same column. If it does a blind replace instead of a merge, a routine, innocuous-looking sync (like a page-load refresh) becomes a silent, recurring cost leak. It wasn't caught by tests because the surface behavior looked correct: the extractor "self-healed" by just re-extracting, so nothing errored or looked broken, it just kept spending money.
How to apply: when writing or reviewing any upsert into a raw/payload_raw-style JSON column in CreatorTrack (or elsewhere), check whether any other module reads a nested key out of that same column for cached/derived state. If so, the upsert must preserve those keys explicitly (merge, not replace) as part of the same contract that already exists for the transcript columns. Treat "route resync overwrites raw JSON wholesale" as a pattern to grep for whenever adding a new extraction/derivation feature that piggybacks on an existing raw-payload column.
[Claude Code]