Skip to main content

Writing

Blog

Notes on commerce engineering, AI integrations, and storefront patterns from production work. Next.js, Centra, Algolia, Convex, and what actually ships.

All posts

Multiple Klaviyo metrics named "Placed Order"

Sander Korf4 min read

Centra order mail stalled when Klaviyo held two Placed Order metrics. I match API integration, seed backfill metrics, and skip flows instead of failing sync.

klaviyocentra

Read more

Webhook dedupe keys need signed bytes

Sander Korf5 min read

HR webhooks retry for a day. My dedupe key had to come from signed body bytes, not headers or picked JSON fields. Review caught all three mistakes.

nextjsvercelworkflows+1

Read more

NestJS boot: reading 'provide' on undefined

Sander Korf4 min read

Green CI, dead staging: a NestJS module cycle hid an eager export until a new import flipped evaluation order. Staging only; production never got the build.

nestjstypescriptjest

Read more

A branch that never renders still ships

Sander Korf4 min read

App Router bundles follow static imports, not branches. Draft Sanity overlays and payment icons cost every shopper until imports matched conditions.

nextjssanityperformance+1

Read more

Shadow a new model before it decides

Sander Korf5 min read

Run a faster classify model beside the live reader without delaying replies. Per-step gates and an unawaited journal keep turns safe as you measure agreement.

convexllmtypescript+1

Read more

Correcting a cart you do not own

Sander Korf5 min read

Shopify POS owns the receipt. A bag tile can only add or remove whole lines async. I serialized swaps, claimed paper per cotton line, and re-read the live cart.

shopifypostypescript+1

Read more

Compare a rewrite after every event

Sander Korf4 min read

Porting routing from hand-written logic to a declarative flow? Drive both from one seeded client and compare what each waits for after every event.

testingtypescriptvitest+1

Read more

Read env vars by name, never by spread

Sander Korf4 min read

Spreading process.env silently dropped Convex kill switches. Read each variable by name from a known list, and audit prod before a fix goes live.

convexnextjstypescript+1

Read more

Migrate before traffic, never at boot

Sander Korf4 min read

Boot-time migrations that fail open can ship new code against an old schema. Run migrations once as a deploy gate before traffic moves.

postgresnestjstypeorm

Read more

A denoiser can hide the noise you warn about

Sander Korf4 min read

Clean the mic before speech to text and your loud-room warning reads clean audio too. Keep a raw meter for it, and measure before you ship.

reacttypescriptaudio+1

Read more

Withdraw must reopen mirrored invite status

Sander Korf4 min read

A creator withdrew, the invitation stayed applied, and re-invites failed. If a row copies another row's state, the undo path has to move it back.

postgresnestjstypeorm

Read more

Anonymize users on delete, keep payment rows

Sander Korf5 min read

A CASCADE on the payments table turned one creator's delete into lost history for the business. Soft-delete, anonymize, keep it.

postgresnestjstypeorm+2

Read more

Empty CMS hours must not clear Google Maps

Sander Korf4 min read

Retail CMS hours sync to Google Maps on publish. Empty regularHours in a PATCH body cleared live weekday hours because updateMask treats blanks as deletes.

googlesyncnextjs+2

Read more

An empty page is not the end of the list

Sander Korf4 min read

Logged-in shoppers saw an empty My orders screen while older rows still existed. hasMore followed filtered rows, not the raw API page.

paginationtanstack-querynextjs+2

Read more

A kill switch must default to on, at both ends

Sander Korf4 min read

I flip Firebase kill switches when OAuth breaks; full deploy wiped my console off, and static reads hid sign-in buttons until I fixed template defaults.

firebaseremote-configfeature-flags+2

Read more

Vercel Workflows: typed errors lost at steps

Sander Korf4 min read

Search-index Vercel Workflows degradations all logged unknown fetch_failed. After a step failed, only the error message survived across the step boundary.

typescriptverceltesting+1

Read more

Docs allowlist broke card decline redirect

Sander Korf3 min read

Card declines sent shoppers to /undefined after HTML sanitization stripped data-failed-return-url. Contract-test live payment snippets, not doc examples.

nextjssecuritypayments+1

Read more

Shared sort keys collapse unlisted PLP groups

Sander Korf4 min read

On a colour-sorted fashion PLP, unlisted colours shared one Algolia sort attribute and one hue reappeared mid-grid until each group got a stable id-only key.

algolianextjsshopify

Read more

RHF field errors hide under React Compiler

Sander Korf4 min read

I fixed register and forgot-password where RHF stored errors but the UI never painted them until fields used useFormState.

reacttypescriptnextjs

Read more

Thinking budget on Google and Vertex AI routes

Sander Korf3 min read

A Gemini thinking cap under providerOptions.google is ignored when the gateway answers as Vertex. Mirror the same thinkingConfig on both provider keys.

llmtypescriptai-sdk

Read more

Force toolChoice until measured memory write

Sander Korf4 min read

Flash skipped record_memory on multi-step agent replies. Forcing toolChoice on step 0 only still left pending measures and empty read-back cards.

llmconvextypescript

Read more

When srcset maxes at 1000w on retina PDP

Sander Korf4 min read

PDP packshots looked soft on phones while cards stayed sharp. sizes asked for retina pixels but srcset stopped at 1000w. I matched candidates and one builder.

nextjssanityplaywright+1

Read more

Centra incomplete address is permanent

Sander Korf3 min read

A paid Centra order with a blank city blocked our warehouse export queue for eighty minutes. Classify bad address data as permanent and ack the event.

centratypescriptmonorepo

Read more

Superseded listen start must not call stop

Sander Korf4 min read

Guided session app granted mic access then showed could not start listening. A stale Listen start called stop and bumped the generation counter past the winner.

reactwebsocketsaudio

Read more

Tax estimate is not the creator payout

Sander Korf4 min read

Creator marketplace cards reused a Stripe Tax preview total as payout. Creators read fee plus tax as cash in hand. Split payoutCents from the estimate.

reacttypescriptpayments

Read more

Withhold ended LLM steps after move-on

Sander Korf3 min read

Fast models re-showed three resistance memories after move-on. Ended-step instructions must leave the system prompt, not fight a movedOn flag.

llmconvextypescript

Read more

Nested Embla: watchDrag and viewport gutters

Sander Korf4 min read

On a Centra PDP, nested Embla carousels for card media and edge-bleed rails hit two traps. Use watchDrag on the parent; safe-area inset on the viewport.

centraemblanextjs+1

Read more

Instant Nav needs an SSR shell, not ssr false

Sander Korf3 min read

Fashion liveshow soft nav painted an empty shell. Instant Nav locks static HTML; next/dynamic with ssr false and cookie awaits blocked landmarks e2e needed.

nextjsbambuserperformance

Read more

Revalidate type lists, not only references

Sander Korf3 min read

Liveshow detail refreshed after Sanity edits but the overview stayed stale for hours. Type-based GROQ lists never matched reference-only revalidation.

sanitynextjscache

Read more

Sparse webhooks need hydrate or a 503 retry

Sander Korf3 min read

BamHub liveshow webhooks sync into Sanity for a public listing. Sparse payloads left shows unpublished until I hydrated from the API or returned 503 for retry.

sanitynextjsbambuser

Read more

Late STT must no-op after transcript purge

Sander Korf4 min read

Purge deleted transcript overlays while vendor STT still ran. Completion handlers recreated erased text. Missing overlay row means return, not upsert.

convex

Read more

Convex rate limiter: check both buckets first

Sander Korf4 min read

Convex rate limiter on thread and global buckets can charge the session when global is empty. Check both rate limits before STT spend, then throw to roll back.

convex

Read more

Map null keys collapse Shopify live variants

Sander Korf3 min read

Shopify PLPs showed wrong Size facets when variant overrides keyed a Map by null shopifyProductId on consolidated locales. Use the store Product GID.

algoliashopifysanity

Read more

Algolia v5 replaceAllObjects false-timeouts

Sander Korf4 min read

Fashion full-catalog rebuilds false-fail when replaceAllObjects hits fifty waitForTask polls. Large indexes need a custom copy, batch, and move path.

algolianextjsshopify

Read more

RN Modal kills GestureDetector button taps

Sander Korf3 min read

Accept buttons in my Expo app worked everywhere except RN Modal dialogs. GestureDetector taps died silently because Modal renders outside the gesture root.

exporeact-nativegesture-handler

Read more

Keep nav backdrop open until close completes

Sander Korf4 min read

On a fashion storefront mega menu, the dim layer snapped off when Base UI cleared the menu value at the start of the exit animation, not the end.

nextjsreacta11y

Read more

Nested remote cache breaks Next.js prerender

Sander Korf4 min read

Homepage prerender on a Centra Next.js build failed with 'Filling a cache during prerender timed out'. Nested use cache remote boundaries caused the hang.

nextjscentraperformance

Read more

Minified React error #441 in Next.js: the fix

Sander Korf4 min read

Minified React error #441 broke soft navigation in a Next.js app with Cache Components. Here is what caused it in production and the fix that stopped it.

nextjsreactconvex

Read more

Centra card video: muted autoplay after mount

Sander Korf3 min read

PLP cards with optional Sanity video stay silent or flash wrong when autoPlay lives in SSR. I start muted loops in a client effect and respect reduced motion.

centrasanitynextjs

Read more

Convex Identify reducer before admin UI

Sander Korf4 min read

Clinicians read Identify as a spreadsheet. Engineers cannot prove it ends. I seed Convex, write a pure reducer, and replay the sheet paths in Vitest first.

convexvitesttypescript

Read more

Pick a winner when Identify Compare stalls

Sander Korf4 min read

When two movements stay yes after Compare, looping the same chips teaches nothing. I pause for a pick, hatch the losers, and end the run as a hypothesis.

convextypescriptvitest

Read more

Lock Identify rules to a typed Convex menu

Sander Korf4 min read

Identify is a clinician movement engine on Convex. Spreadsheet authors invent words weekly; lock metrics and actions to validators so the reducer stays boring.

convextypescript

Read more

Klaviyo email video? Poster, not video tag

Sander Korf4 min read

Gmail and Outlook strip video in campaigns. Ship a poster image with an optional play overlay and an outbound link baked at send time from the CMS.

klaviyoreact-emailsanity

Read more

Biome bans vendor imports in shop UI

Sander Korf3 min read

On a Centra fashion storefront, product cards broke when commerce API types leaked into JSX. Map to storefront DTOs and ban vendor imports in shop components.

centrasanitybiome+1

Read more

Centra CanonicalPath fixes Instant Nav shell

Sander Korf3 min read

Collection pages stuck on loading after Instant Nav. Own PLP slugs per locale, 308 the rest, and skip waiting on empty query strings for the shell.

centranextjsseo

Read more

Server-side country labels fix E2E fills

Sander Korf3 min read

Checkout country dropdowns rebuilt after hydration and emptied a test fill. Precompute localized names on the server before the form paints.

intlnextjsplaywright

Read more

Next.js useOffline: env-shape shared config

Sander Korf4 min read

Shared Next config had offline detection always on, so local dev inherited HEAD polls meant for deploy. I now derive the flag from Vercel env at config time.

nextjsvercel

Read more

Centra PDP add to cart stays pressable

Sander Korf4 min read

A fashion PDP that greys out add to cart until size is picked looks broken. Validate on submit, show the hint after a miss, then focus the chips.

centranextjstailwind

Read more

Convex session audio purge is terminal-only

Sander Korf3 min read

A research product records session audio apart from chat. Deleting a thread must not wipe the rolls. Admin purge is terminal-only and deletes chunks first.

convexnextjs

Read more

Sanity Look pins on a Centra PDP cover crop

Sander Korf3 min read

Editors pin Shop the Look dots on the full photo. A tall cover crop on the product page slides those dots off the garment unless you remap them once.

sanitycentranextjs+1

Read more

Centra colour siblings dedupe by uri

Sander Korf4 min read

Colour swatches showed Black twice on a fashion PDP. Dedupe siblings on the URL you paint, then hide the picker when only one colour exists.

centranextjstailwind

Read more

Centra size guide transposes the chart

Sander Korf3 min read

Fashion size guides store measurements as rows. Shoppers need size rows on the product page. Flip the sheet once so the numbers match the layout.

centranextjstailwind+1

Read more

Centra OOS size swaps the primary CTA

Sander Korf4 min read

An out of stock size on a fashion product page should not grey out checkout. Flip the main button to a notify action and reuse one overlay for every sheet.

centranextjstailwind+1

Read more

CSS view() timelines vs IntersectionObserver

Sander Korf4 min read

Below-the-fold blocks on my Next.js site faded in with a client observer. Scroll timelines do the fade now, and older browsers just show the content.

cssnextjstailwind+1

Read more

Next.js MDX in HTML, not behind Suspense

Sander Korf4 min read

Crawlers never ran my blog JavaScript, so they got a shell with no article. I flattened the static pages and now test the HTML with scripts turned off.

nextjsmdxplaywright+1

Read more

Convex Vercel deploy without GitHub Actions

Sander Korf4 min read

Convex Vercel deploy wins over a parallel Actions pipeline. One host build runs Convex on preview and production; GitHub Actions stays on tests only.

vercelconvexgithub-actions+1

Read more

Algolia filter taps paid INP for new objects

Sander Korf4 min read

Fashion PLP filter chips felt frozen when an observability hook retried on new object refs each render. Key the effect on queryID, not the results bag.

algoliainstantsearchnextjs+2

Read more

Homepage skip links jumped the fold late

Sander Korf3 min read

I awaited a cached translation for a skip link and the Shopify homepage jumped. That one string now renders inside the section that already waits.

next-intlnextjssanity+1

Read more

Next.js Suspense fallbacks wreck CLS P95

Sander Korf3 min read

Empty loading slots made my CMS blocks jump in late and wrecked layout stability. I now reserve height per section type and watch P95, not P75.

nextjssanityshopify+2

Read more

Sanity labels hid my Algolia merch pins

Sander Korf3 min read

On a fashion storefront PLP, merchandisers pin hero SKUs in Sanity CMS but Algolia ignores them when Groq filters on the desk title instead of the schema id.

algoliasanitynextjs+1

Read more

Keep Algolia admin keys off the storefront

Sander Korf3 min read

A fashion PLP runs Algolia InstantSearch in the browser. Only the search-only key belongs in client code; writes stay on the server with the admin key.

algoliainstantsearchnextjs+1

Read more

Centra to Klaviyo tags need a plugin contract

Sander Korf4 min read

Fashion checkout mail never arrives if you invent the event names. Copy the plugin tags and split the catalog id so receipts and restock emails actually send.

centraklaviyo

Read more

Dutch Klaviyo receipts arrived in English

Sander Korf3 min read

Dutch shoppers got English order emails from Klaviyo. I now pick the storefront language on the server before the event leaves, not in a default template.

next-intlklaviyocentra+1

Read more

Staging deep links must not hijack production

Sander Korf3 min read

A mobile app ships production and staging builds. Reusing production Universal Link hosts sends QA to the store app and makes staging reset links look broken.

expoeasdeeplinks

Read more

EAS SHA-1 fails under Worklets Bundle Mode

Sander Korf4 min read

My Expo cloud build died hashing the JS bundle. I pinned Worklets Bundle Mode to false in Babel so Metro stopped hashing a graph I never asked for.

expoeasmetro+1

Read more

Reclaim Firebase orphan without password wipe

Sander Korf4 min read

An existing email is not always a blank account. I send a password reset when a login already exists, and I only set a password when none is on file.

firebaseexpo

Read more

Full Stack AI Engineer from Amsterdam

Sander Korf2 min read

I ship agentic Convex workflows and production Gen AI from Amsterdam. Posts cover what I build, who I work with, and what usually breaks in production.

welcomepersonal

Read more