How We Stopped a CMS Sync from Eating Manually-Edited Fields
if a sync job upserts on a shared key, every re-run can silently blow away manual edits. Add a per-record lock flag the importer checks before writing
A lab notebook: what I'm learning while building with AI, written as I go.
if a sync job upserts on a shared key, every re-run can silently blow away manual edits. Add a per-record lock flag the importer checks before writing
launchctl bootstrap from a repo path doesn't survive a reboot. Copy the plist to ~/Library/LaunchAgents/. But the actual lesson is deeper — if you
Don't make Make.com reconstruct your data. Pre-build exactly what it needs in the payload — your server already has all the context.
Don't retry 4xx. A 401 won't fix itself after three attempts — it'll just fail slowly instead of fast.
Your API client timeout must live under your platform's hard ceiling — not above it. And retrying a 4xx just burns the budget twice.
Two Claude Code hooks aren't enough — there are four ways a session can end, and only one of them is obvious. Wire all four or you'll keep losing se
Two error-propagation traps in Next.js server actions — redirect() silently eaten by a try/catch, and Vercel's platform-level 4.5MB cap disguised
One confirm dialog is not enough. Stack four guards — flag, hardcoded env ref, pre-approved mapping file, and a typed 'DESTROY' prompt that shows ro
When one webhook fans out to multiple competing recipients, each one needs its own redacted view of the data. Paragraph-level stripping works — but
When you shell out to claude -p (headless Claude) in a subprocess, MCP tools don't just appear — you have to wire them in explicitly. And the flag you
The model that won my general text bake-off quietly dropped 4 real commitments when I aimed it at meeting transcripts. Recall matters more than prec
Never use a 302 redirect to 'protect' an API route. A redirect is page protection — not a gate. Exempt /api/ from your middleware, then add the r
Every iMessage turn spawns a fresh claude -p process. 'Session memory' doesn't exist. If your agent doesn't write to disk before it exits, the lea
Stop aggregating in JavaScript. Move the math into a Postgres SQL function, call it via supabase.rpc(), and MATERIALIZED the shared base CTE so
If your Supabase aggregation numbers look plausible but wrong, check the row count first. PostgREST silently caps at 1,000. Push the math into a SQL
Make.com fires an email on every scenario error. The right signal isn't error count — it's failure mode. Classify first, route second.
LLMs drift. Prompting them to stay inside a trust boundary is advisory. Code-level firewalls are mandatory.
Don't build a long-lived AI agent process. Spawn one subprocess per message, return text, die. Decouple everything else.
One shared Supabase table + a roles array beats two per-app contact tables. But the canonical isn't done when the rows merge — grep every hardcoded li
I used a Zero-Width Joiner to mark every outbound Apollo message. The decoder ate the marker. A fallback path fed Apollo its own NSArchiver garbage inst
what we were building
CREATE OR REPLACE FUNCTION can change a Postgres function's body — but NOT its return shape. Add or remove a column from RETURNS TABLE(...) and
When PostgREST has two paths between two tables, it picks neither — and one of those failures looks exactly like 'no data.'
encodeURIComponent leaves ' ! ( ) unencoded. When your URL goes into XML, ' gets escaped to ' — then decoded back to a literal ' be
better-sqlite3 can't open a bundled SQLite file from Vercel's /var/task layer even when existsSync returns true. Copy it to /tmp on cold s
serverExternalPackages is step one. There are three more after it.
Switching from row-by-row upserts to 100-row batches in our Shopify → Supabase orders sync cut API round-trips by ~50×. The fix was five lines. The
If your polling job widens its lookback window on failure, it will silently replace your watermark with a guess. The fix: the cursor only ever advan
If you're syncing Recharge subscriptions to a database and your product links are all null — check externalproductid.ecommerce, not externalproduc
If you have order history, you already have inventory history. Replay the transactions, build the snapshots.