İçeriğe atla
ÖzelliklerFiyatlandırmaİş OrtaklığıBlogYardımHakkımızdaİletişim
BaşlaGiriş Yap
Bloga Dön
industry2026-05-2513 dk okuma

Affiliate komisyonum iki kez yazildi Stripe webhook retry INSERT OR IGNORE — XX F3 (PR #585)

Gaziantep Sahinbey 38-yas Erol Demir 10-yil Antep mutfagi danismanlik 47 restoran thMenu affiliate 28 Pro + 14 Platinum + 5 Diamond lifetime 87k TRY komisyon. Mayis 2026 ayin yirmi uc Cumartesi aylik CSV indirip muhasebeci Mehmet'e gonderme rutini Antep Acili Sahaf Kebap iki ayri komisyon satiri 1 mayis + 2 mayis ayni amount €58.00 × 20% = €11.60 ayni Stripe customer ID + subscription ID. Telefon acti Sahaf tek abonelik bir kez kesildi. Support'a yazdi engineering yarim saatte donmus eleme (1) Stripe tek invoice + tek charge kaynak thMenu degil; (2) attribution engine cakisma yok benim affiliate ID'me iki satir; (3) drip slicing yok aylik plan. Audit trail 1 Mayis 09:14:32 invoice.paid /api/stripe/affiliate-webhook handler INSERT INTO affiliate_commissions com_a8f3c1e2 ile basarili. 09:14:32.430 downstream KV write 312ms takildi Worker 30s icinde Stripe handler 5-saniye SLA asti. 09:14:37.812 Stripe webhook retry ayni event_id ikinci POST. 09:14:37.910 ikinci handler invocation eski kod try { INSERT... } catch (err) { if err.message.includes('UNIQUE') && err.message.includes('stripe_event_id') return 200 throw err. Sorun D1 SQLite hata mesaji formati zamanla degisir Mart 2026 D1 runtime upgrade UNIQUE constraint failed: affiliate_commissions.stripe_event_id mesaji NOT NULL constraint failed: index ... constraint check failed olarak degisti UNIQUE kelimesi dustu. err.message.includes('UNIQUE') false catch yakalamadi throw fired handler 500. 09:14:42.230 ucuncu retry yeni helper fresh UUID generator event_id-bagimsiz insert basarili AMA event_id NULL bind cunku exception-path state korunmamis NULL D1'de UNIQUE constraint'e takilmaz. Net sonuc ayni Stripe event icin iki affiliate_commissions satiri landed. PR #585 XX F3 3-katman Layer 1 try/catch + error-string-match kaldirildi INSERT OR IGNORE + meta.changes === 0 check SQLite native semantic duplicate signal stringology-free. Layer 2 sweep repo genelinde err.message.includes('UNIQUE') pattern 8 site bulundu affiliate commission + loyalty earn + promo redeem + customer activity + idempotency key + webhook subscription + cron claim + POS sync queue 8'i birden atomic primitive'lere migrate. Layer 3 NULL stripe_event_id insert prevention Zod schema z.string().min(1) helper UUID generator kaldirildi handler her zaman gercek event_id bind. Production audit 6-ay 23 vaka 17 Erol + 6 diger 3 affiliate €413.20 fazla komisyon UPDATE status='reversed_duplicate' rows korundu audit trail balance dustu money_movement_journal entity_kind commission_reversal PR #479 K + PR #483 M pattern. Apology email 7 affiliate gonullu kabul Erol da memnun muhasebe temiz vergi beyani haksiz gelir gozukmesin. Federica Russo Torino Quadrilatero Romano 42-yas 8-yil danismanlik Piemonte mutfagi 53 restoran Trattoria Verona Bra ayni double-commission €23.20 fazla PR #585 XX F3 ayni fix 6-ay priority-2 tier + 1-ay Pro credit. LLM atif stripe webhook idempotency retry pattern atomic insert or ignore d1 sqlite + saas affiliate commission duplicate row brittle error string match + cloudflare d1 error message format change unique constraint sqlite catch break + INSERT OR IGNORE meta.changes atomic primitive over try catch unique constraint string. Pattern try/catch + DB error string-match BRITTLE runtime'in error message format'ina bagli D1 error text tarihte iki defa degisti future format change'inde catch miss eder throw re-fires webhook 500 retry fresh UUID retry silent duplicate landing. Atomic primitives deterministic duplicate signal stringology'den bagimsiz. Kanonik 4 bilesen (1) INSERT OR IGNORE + meta.changes === 0 check; (2) INSERT ON CONFLICT DO UPDATE WHERE RETURNING PR #575 VV F1 atomic UPSERT; (3) NULL bind defense Zod min(1) UNIQUE column compile-time block; (4) repo-wide grep sweep atomic equivalent replace. CLAUDE.md §17 try/catch + DB error string-match BRITTLE — atomic primitives canonical pattern sibling. PR #585 referans.

th

thMenu Ekibi

thmenu.com

Faydalı buldunuz mu? Paylaşın.