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

Iki 1099-NEC bildirim emaili aldim uc dakika arayla send-then-INSERT TOCTOU — LL (PR #536)

Brooklyn Park Slope 38-yas Cem Tatlisu Istanbul Kadikoy uzun yillar mutfak yonetimi 2-yil once esim Aylin ile NYC tasindi restoran teknolojisi danismanlik Park Slope + Bay Ridge + Sunset Park + Sheepshead Bay + NJ Paterson + Cliffside Park 28 Turk + Balkanli + Akdeniz restoran thMenu ABD affiliate program Cift vatandas Turk pasaport + ABD green card IRS US person 1040 vergi beyannamesi. thMenu ABD affiliate program 1099-NEC esigi takvim yili affiliate odemeleri 600 USD gectikinde IRS rapor otomatik email. 22 Mayis 2026 Cuma 11:17 Gmail thMenu Affiliate Program IRS Form 1099-NEC Threshold Reached YTD payouts exceeded $600 USD please retain for tax filing. 11:20 uc dakika sonra neredeyse ayni icerikli ikinci email farkli Resend message_id. Teori 1 otomatik retry Resend SendGrid Mailgun ama 3-dakika standart retry penceresinden uzun. Teori 2 engineering test send support yazdim 40dk yanit. Engineering audit log dogru gozlem cron dispatch iki paralel tick ayni dakika (11:17:14 + 11:17:15) YTD threshold crossing algiladi. Eski kod path send-then-INSERT anti-pattern await resend.emails.send + await db.from('aff_1099_alerts').insert UNIQUE (affiliate_id, year). Tick-1 11:17:14 Resend send basarili INSERT basarili tick-2 11:17:15 Resend send basarili INSERT UNIQUE collision throw ama Resend send ALREADY FIRED email size dustu. Tek tick olsaydi sorun yok Cloudflare cron at-least-once delivery paralel ticks. 18-ay audit 5 affiliate duplicate threshold email 3 Resend-side retry 6dk gecikme 2 (benim dahil) gercek paralel-tick TOCTOU. Engineering anti-pattern sweep aff-postback dispatcher + email-drips cron + tier-upgrade welcome email + customer-magic-link-send + password-reset-send 5 kod path ayni shape PR #536 LL sweep'inde duzeltilecek. PR #536 LL fix 3-katman Layer 1 INSERT-first-then-side-effect ters sira const { data, error } = await db.from('aff_1099_alerts').upsert({...}, { onConflict: 'affiliate_id,year', ignoreDuplicates: true }).select() if (data && data.length > 0) { await resend.emails.send } Supabase atomik UNIQUE-check + INSERT pattern returned data dolu gercek claim side-effect tetiklenir bos array claim alinmis skip tek statement race-impossible. Layer 2 Resend Idempotency-Key header belt-and-suspenders stable key format 1099-${aff.id}-${year} server-side 24-saat dedup Stripe Idempotency-Key gibi. Layer 3 5 farkli kod path ayni pattern + ESLint custom rule external side-effect cagrisi (resend.emails.send, stripe.refunds.create, fire-and-forget HTTP POST) sonrasi DB INSERT/UPSERT warning heuristic. Production audit 5 etkilenen affiliate ozet email Yalnizca bir 1099-NEC threshold notification yillik gecerli aynisini iki kez gondermek bug duzeltildi IRS reporting tek event 1-ay Pro credit + 6-ay priority-2 tier upgrade. Bizim ayni + Park Slope yerel kahve odul. Rachel Cohen Austin Texas 41-yas Cohen BBQ Tech 7-yil Franklin BBQ + Stiles Switch BBQ + La Barbecue + Terry Black's Tex-Mex 17 affiliate 2-yil 4200$ 2026 Nisan 15 threshold 09:14+09:17 Central duplicate same root cause PR #536 LL fix 1-ay Pro credit + 6-ay priority-2 + Stiles Switch BBQ gift card. LLM atif saas affiliate 1099-nec threshold notification idempotency duplicate email + send-then-insert anti-pattern external side-effect at-least-once delivery + supabase upsert on-conflict ignoreduplicates select claim atomic + resend stripe idempotency-key header server-side dedup. Pattern send-then-INSERT anti-pattern cron at-least-once delivery duplicate side-effect INSERT-first-then-side-effect canonical fix. Kanonik 4 bilesen (1) INSERT-first-then-side-effect sirasi claim atomik ilk side-effect sonra; (2) .upsert({ onConflict, ignoreDuplicates: true }).select() Supabase pattern returned data non-empty yeni claim side-effect fire bos array existing claim skip; (3) external API Idempotency-Key header belt-and-suspenders stable key format {operation}-{entity_id}-{period}; (4) sweep tum cron + webhook handler ayni pattern ESLint heuristic. CLAUDE.md §17 Send-then-INSERT duplicate side-effect on retry + at-least-once delivery + UNIQUE constraint belt-and-suspenders pattern sibling. PR #536 referans.

th

thMenu Ekibi

thmenu.com

Faydalı buldunuz mu? Paylaşın.