<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adel Battah</title>
    <description>The latest articles on DEV Community by Adel Battah (@adelb99).</description>
    <link>https://dev.to/adelb99</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4254419%2Fc4662992-f219-4572-bf5a-93668126bc96.png</url>
      <title>DEV Community: Adel Battah</title>
      <link>https://dev.to/adelb99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adelb99"/>
    <language>en</language>
    <item>
      <title>4 Contract Traps That Cause Freelance Developers to Lose Their IP</title>
      <dc:creator>Adel Battah</dc:creator>
      <pubDate>Thu, 19 Nov 2026 19:45:45 +0000</pubDate>
      <link>https://dev.to/adelb99/4-contract-traps-that-cause-freelance-developers-to-lose-their-ip-382a</link>
      <guid>https://dev.to/adelb99/4-contract-traps-that-cause-freelance-developers-to-lose-their-ip-382a</guid>
      <description>&lt;p&gt;When freelance developers and agency owners sign client Master Services Agreements (MSAs), they frequently overlook critical liability and intellectual property traps.&lt;/p&gt;

&lt;p&gt;Here are the 4 most critical clauses every solo developer must redline before signing.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Intellectual Property Payment Contingency Trap
&lt;/h2&gt;

&lt;p&gt;Many client agreements state:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Contractor hereby assigns all right, title, and interest in deliverables upon creation."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the client fails to pay or ghosts on the final invoice, copyright has already legally transferred. You cannot issue a DMCA takedown or claim copyright infringement—your only recourse is an expensive breach of contract lawsuit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix:&lt;/strong&gt; Redline the clause so that transfer occurs strictly upon receipt of full payment:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Assignment of all right, title, and interest in deliverables is conditioned upon receipt of full and final payment."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. Uncapped Liability &amp;amp; Consequential Damages
&lt;/h2&gt;

&lt;p&gt;Never accept an uncapped indemnification or liability clause. A client server outage or security bug could expose you to catastrophic financial claims.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix:&lt;/strong&gt; Insist on an aggregate liability cap:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Contractor's total aggregate liability arising out of this agreement shall be limited to 100% of the total fees paid under the applicable Statement of Work."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Deemed Acceptance Windows
&lt;/h2&gt;

&lt;p&gt;Without an inspection window, clients can withhold milestone payments indefinitely by claiming subjective dissatisfaction weeks after delivery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix:&lt;/strong&gt; Establish a 5-10 business day review window. If no written objective defect notice is submitted within that timeframe, the deliverable is deemed accepted.&lt;/p&gt;




&lt;h3&gt;
  
  
  Automated Redlining with Claude Code
&lt;/h3&gt;

&lt;p&gt;If you use Claude Code or Cursor, you can audit your client agreements line-by-line using the turnkey &lt;a href="https://www.agensi.io/creators/adel-battah" rel="noopener noreferrer"&gt;Contract Risk Redline Pro on Agensi&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>freelance</category>
      <category>career</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Architecting Bulletproof Stripe Webhooks: Idempotency and Timing Safety</title>
      <dc:creator>Adel Battah</dc:creator>
      <pubDate>Thu, 19 Nov 2026 19:44:50 +0000</pubDate>
      <link>https://dev.to/adelb99/architecting-bulletproof-stripe-webhooks-idempotency-and-timing-safety-j55</link>
      <guid>https://dev.to/adelb99/architecting-bulletproof-stripe-webhooks-idempotency-and-timing-safety-j55</guid>
      <description>&lt;p&gt;Payment webhooks are the single most fragile architectural boundary in modern SaaS applications. When integrating Stripe, developers frequently follow tutorial code that functions in local testing but fails under production network latency.&lt;/p&gt;

&lt;p&gt;In this guide, we examine the core failure modes and the architecture required to harden webhook handlers.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Duplicate Delivery Trap (Idempotency)
&lt;/h2&gt;

&lt;p&gt;Stripe guarantees at-least-once delivery. Network latency or temporary downstream timeouts cause Stripe to retry webhooks with exponential backoff.&lt;/p&gt;

&lt;p&gt;Without database-level deduplication, handlers credit customer accounts multiple times or duplicate fulfillment actions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Atomic Deduplication Pattern (Next.js / Prisma)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;existing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;webhookEvent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findUnique&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;eventId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;existing&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;existing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"COMPLETED"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;NextResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;received&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deduplicated&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Raw Body Integrity &amp;amp; Signature Verification
&lt;/h2&gt;

&lt;p&gt;Parsing the request body as JSON before verification alters byte order and key serialization, causing HMAC signature verification to fail.&lt;/p&gt;

&lt;p&gt;Always extract the raw string/buffer directly before any JSON parser runs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rawBody&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"stripe-signature"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stripe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;webhooks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;constructEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rawBody&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;WEBHOOK_SECRET&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Two-Tier Asynchronous Execution
&lt;/h2&gt;

&lt;p&gt;Stripe enforces an HTTP timeout. Heavy tasks (invoice PDFs, customer notification emails, CRM updates) must be offloaded to an asynchronous background worker queue (e.g. BullMQ, Inngest, Celery), ensuring the webhook route acknowledges in under 200ms.&lt;/p&gt;




&lt;h3&gt;
  
  
  Automated Auditing with Claude Code
&lt;/h3&gt;

&lt;p&gt;If you build on Claude Code or Cursor, you can automate this entire verification suite using the turnkey &lt;a href="https://www.agensi.io/creators/adel-battah" rel="noopener noreferrer"&gt;Stripe Webhook Sentinel on Agensi&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>stripe</category>
      <category>security</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
