<?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: Session Replay</title>
    <description>The latest articles on DEV Community by Session Replay (session_replay).</description>
    <link>https://dev.to/session_replay</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%2Forganization%2Fprofile_image%2F14592%2F1d0ec0c8-ca04-4954-aefc-2cded833cb47.png</url>
      <title>DEV Community: Session Replay</title>
      <link>https://dev.to/session_replay</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/session_replay"/>
    <language>en</language>
    <item>
      <title>"I Was Charged Twice." Disabling the Submit Button Does Not Fix the Version That Comes From the Back Button.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Fri, 27 Nov 2026 13:57:38 +0000</pubDate>
      <link>https://dev.to/session_replay/i-was-charged-twice-disabling-the-submit-button-does-not-fix-the-version-that-comes-from-the-1p4k</link>
      <guid>https://dev.to/session_replay/i-was-charged-twice-disabling-the-submit-button-does-not-fix-the-version-that-comes-from-the-1p4k</guid>
      <description>&lt;p&gt;A customer writes in: they were charged twice. You open the logs and find two &lt;code&gt;POST /checkout&lt;/code&gt; requests, identical bodies, both answered 200, both perfectly valid. Nothing failed. The code did exactly what it was asked, twice.&lt;/p&gt;

&lt;p&gt;The usual diagnosis is a double click, and the usual fix is to disable the button on submit. That fix is real, and it does nothing about one of the commonest ways the second request gets sent, because that one never touches your page at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  The second request your JavaScript never sees
&lt;/h2&gt;

&lt;p&gt;When a form &lt;code&gt;POST&lt;/code&gt; is answered with a page directly, that page only exists as the result of the &lt;code&gt;POST&lt;/code&gt;. Press back to it, or forward, or reload it, and the browser cannot show it again without sending the form again. So it asks. Chrome's error page for the back-and-forward case reads, in Chromium's own source:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Reload, and the dialog is the familiar "Confirm Form Resubmission". Either way, if the person confirms, the browser replays the stored request: same URL, same body. Your submit handler does not run, the disabled button is not involved, and no debounce can intercept it. From the server's side it is indistinguishable from the first submission.&lt;/p&gt;

&lt;p&gt;The person rarely reads the warning as "this will charge you again". They read it as an obstacle between them and the page they wanted, and they click through.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to tell which one you have
&lt;/h2&gt;

&lt;p&gt;The two requests look the same, but the gap between them does not.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A double click&lt;/strong&gt; puts the second request within a second of the first, with nothing in between.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A resubmission&lt;/strong&gt; comes later: seconds or minutes, often with the person's other requests in between, because they went somewhere else and came back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is as far as the logs go. They tell you two requests arrived; they cannot tell you the person pressed back, saw a dialog and pressed the button on it. The customer usually cannot tell you either, because to them it was one purchase and an annoying popup.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix that actually holds, and the version of it that does not
&lt;/h2&gt;

&lt;p&gt;Two parts, and the second is the one that matters for money.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stop producing the prompt.&lt;/strong&gt; Answer the &lt;code&gt;POST&lt;/code&gt; with a redirect to a page loaded with &lt;code&gt;GET&lt;/code&gt; (post, redirect, get). Back and reload then repeat the &lt;code&gt;GET&lt;/code&gt;, which is harmless, and the dialog never appears.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make the second request harmless anyway,&lt;/strong&gt; because redirects get forgotten on one route, and retries come from places other than the back button. That means an idempotency key, and where you generate it decides whether it works.&lt;/p&gt;

&lt;p&gt;Stripe's documentation describes the mechanism: a key the client generates, which "the server uses to recognize subsequent retries of the same request". Retries with the same key return the saved response instead of acting twice.&lt;/p&gt;

&lt;p&gt;The trap is generating the key in the request handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Looks safe. Is not: every submission, including a resubmitted one,&lt;/span&gt;
&lt;span class="c1"&gt;// arrives here and gets a brand new key.&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/checkout"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&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;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&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;await&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;paymentIntents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;idempotencyKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;key&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="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A resubmitted form arrives as a new request, gets a new key, and Stripe correctly treats it as a new payment. The key has to be created when the form is rendered and travel inside the form, because the browser resends the form body exactly as it was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Rendering the form: the key is fixed here, once.&lt;/span&gt;
&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"checkout"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;orderToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&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="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// &amp;lt;input type="hidden" name="order_token" value="&amp;lt;%= orderToken %&amp;gt;"&amp;gt;&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/checkout"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&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;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;token&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;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_token&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// A unique index on order_token: a second request finds the&lt;/span&gt;
  &lt;span class="c1"&gt;// existing order instead of inserting another, however it was produced.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createOnce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;token&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="n"&gt;items&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;await&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;paymentIntents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;idempotencyKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;token&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="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;303&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`/orders/${order.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="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now a double click, a resubmission and a network retry all carry the same token, and all land on the same order.&lt;/p&gt;

&lt;p&gt;One limit worth knowing: Stripe's API v1 documentation says keys can be removed once they are at least 24 hours old, after which a reused key is a new request. Your own unique index is what covers the tab somebody leaves open overnight.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the report needed
&lt;/h2&gt;

&lt;p&gt;"I was charged twice" is a complete description from the customer's side and nearly useless from yours. The thing that separates a double click from a resubmission from a retry is what the person did between the two requests, and that is exactly the part nobody writes down. Fix the endpoint so it no longer matters; until then, the sequence of what they clicked is the only evidence there is.&lt;/p&gt;

</description>
      <category>http</category>
      <category>backend</category>
      <category>payments</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Webhook That Never Arrived Leaves No Error Anywhere. GitHub Will Not Send It Again.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Thu, 26 Nov 2026 13:57:00 +0000</pubDate>
      <link>https://dev.to/session_replay/the-webhook-that-never-arrived-leaves-no-error-anywhere-github-will-not-send-it-again-367d</link>
      <guid>https://dev.to/session_replay/the-webhook-that-never-arrived-leaves-no-error-anywhere-github-will-not-send-it-again-367d</guid>
      <description>&lt;p&gt;Yesterday GitHub had a critical incident: from 15:55 to 16:52 UTC its status page listed Git operations, Actions, Pages, Issues, pull requests, the API and webhooks as degraded, and named the cause as high database load. It was resolved within the hour.&lt;/p&gt;

&lt;p&gt;If you run anything that listens to GitHub webhooks, the outage is over but its effect may not be. Somewhere there may be a deploy that never started, a CI status that never posted, a ticket that never moved. None of it produced an error on your side, because nothing arrived to fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub does not retry
&lt;/h2&gt;

&lt;p&gt;This is the line in GitHub's documentation that most integrations are built without knowing: "GitHub does not automatically redeliver failed webhook deliveries."&lt;/p&gt;

&lt;p&gt;A delivery that failed is recorded as failed, and that is the end of it unless somebody acts. GitHub keeps the record and lets you redeliver it manually, through the repository's webhook settings or the REST API's "Redeliver a delivery" endpoints, but the docs limit that to "webhook deliveries that occurred in the past 3 days". For yesterday's incident, that window closes on Saturday afternoon.&lt;/p&gt;

&lt;h2&gt;
  
  
  You do not need an outage to lose one
&lt;/h2&gt;

&lt;p&gt;The incident is the dramatic case. The everyday one is your own handler.&lt;/p&gt;

&lt;p&gt;GitHub's best-practice guide says to respond within 10 seconds, and spells out what happens if you do not: GitHub "terminates the connection and considers the delivery a failure". So a handler that runs the build, calls three APIs and writes to a slow database before answering will, on a busy afternoon, lose deliveries with nobody noticing. GitHub's own advice is to answer immediately and do the work from a queue.&lt;/p&gt;

&lt;p&gt;The cruel detail is that a timed-out handler often finishes the work anyway. GitHub has marked the delivery failed; your code completed it. Which matters the moment somebody does the right thing and redelivers it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make redelivery safe before you need it
&lt;/h2&gt;

&lt;p&gt;Every delivery carries an &lt;code&gt;X-GitHub-Delivery&lt;/code&gt; header, which the docs describe as "a globally unique identifier (GUID) to identify the event". And, crucially: "If you request a redelivery, the &lt;code&gt;X-GitHub-Delivery&lt;/code&gt; header will be the same as in the original delivery."&lt;/p&gt;

&lt;p&gt;That makes deduplication a one-line rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/github'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&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;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;id&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="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'X-GitHub-Delivery'&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="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&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="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// already handled, possibly after a timeout&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&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="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&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;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'X-GitHub-Event'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&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;body&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&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="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;202&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                                  &lt;span class="c1"&gt;// answer now, work later&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;p&gt;Answer fast, queue the work, record the ID. Then a redelivery of something you already processed is a no-op, and a redelivery of something you never saw does the job it was meant to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  And look for the gap on purpose
&lt;/h2&gt;

&lt;p&gt;The deeper problem is the one that makes this kind of failure expensive: &lt;strong&gt;an event that never arrived looks exactly like an event that never happened.&lt;/strong&gt; Your logs are empty in both cases. Your error tracker is quiet in both cases. The difference only appears when a person notices that the deploy did not go out, and by then the three-day window may have closed.&lt;/p&gt;

&lt;p&gt;So check for it rather than wait for the report. GitHub's REST API has "List deliveries" endpoints for repository, organisation and app webhooks, and each delivery records whether it succeeded. A small scheduled job that lists the last day's deliveries and redelivers the failures turns "it just didn't happen" into something that fixes itself, and turns an incident like yesterday's into a non-event.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;Most of the bugs worth fearing make noise. These do not. A missing event, a skipped job, a message that was never sent: each one leaves a silence that is indistinguishable from nothing having been needed. If your system reacts to things other systems tell it, decide now how you would know that one of them stopped telling you.&lt;/p&gt;

&lt;p&gt;GitHub's incident page for 25 November, and the documentation quoted above, are the sources here; how other webhook providers retry varies, so check yours rather than assuming it behaves like either.&lt;/p&gt;

</description>
      <category>github</category>
      <category>webhooks</category>
      <category>devops</category>
      <category>backend</category>
    </item>
    <item>
      <title>Firefox 161 Shipped CSS random(). Your Bug Reports Just Lost the Ability to Be Reproduced by Reloading.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Wed, 25 Nov 2026 14:04:42 +0000</pubDate>
      <link>https://dev.to/session_replay/firefox-161-shipped-css-random-your-bug-reports-just-lost-the-ability-to-be-reproduced-by-2a67</link>
      <guid>https://dev.to/session_replay/firefox-161-shipped-css-random-your-bug-reports-just-lost-the-ability-to-be-reproduced-by-2a67</guid>
      <description>&lt;p&gt;Firefox 161, released on Monday, supports the CSS &lt;code&gt;random()&lt;/code&gt; function. Mozilla's notes for developers describe it as generating "a random value within a specified range", optionally stepped, with an optional key to share one random value across several uses.&lt;/p&gt;

&lt;p&gt;It is a lovely feature for confetti, scattered cards and organic-looking layouts. It also introduces something CSS never had before: &lt;strong&gt;a stylesheet that renders differently every time the page loads.&lt;/strong&gt; That matters the day somebody sends you a screenshot of a layout bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the spec says about when the dice are rolled
&lt;/h2&gt;

&lt;p&gt;The specification, CSS Values and Units Level 5, is explicit that a random value is tied to a "random cache name", so that every time the function is evaluated with the same name "it will return the same random base value". Part of that name is "a document identifier identifying the Document the styles are from".&lt;/p&gt;

&lt;p&gt;Two consequences follow, and both matter for debugging:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Within one page view, the value is stable&lt;/strong&gt; for the same element: re-renders, resizes and style recalculations do not reroll it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every new document gets new values.&lt;/strong&gt; Reload the page and the layout is drawn again from fresh random numbers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the reporter's page had one set of values, and when you open the same URL you get another. If the bug only happens when a card lands at 290px and overlaps the sidebar, it is real, it is in their screenshot, and reloading until you see it is now a game of chance.&lt;/p&gt;

&lt;h2&gt;
  
  
  The key changes how often it differs
&lt;/h2&gt;

&lt;p&gt;The optional &lt;code&gt;&amp;lt;random-key&amp;gt;&lt;/code&gt; decides what shares a value. With the default, &lt;code&gt;auto&lt;/code&gt;, the spec says the value "varies across every random() instance in a multi-component value, across different properties, and across different elements". A named key such as &lt;code&gt;--card&lt;/code&gt; makes every use of that name share one value; &lt;code&gt;element-scoped&lt;/code&gt; and &lt;code&gt;property-scoped&lt;/code&gt; share along one of those axes.&lt;/p&gt;

&lt;p&gt;Read your own stylesheet with that in mind. A &lt;code&gt;random()&lt;/code&gt; with no key on twenty elements is twenty independent rolls, so the number of distinct layouts a user can see is very large, and the one in the bug report may be rare.&lt;/p&gt;

&lt;h2&gt;
  
  
  The escape hatch the spec already provides
&lt;/h2&gt;

&lt;p&gt;The same grammar includes &lt;code&gt;fixed &amp;lt;number [0,1]&amp;gt;&lt;/code&gt;. In the spec's words, with &lt;code&gt;fixed&lt;/code&gt; the function "bypasses the random cache name entirely, and just uses the &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt; as its random base value directly".&lt;/p&gt;

&lt;p&gt;That gives you a deterministic mode for free, and it is worth wiring in before the first report arrives: a test-only stylesheet that overrides each rule with a fixed key, for example &lt;code&gt;random(fixed 0.5, -4deg, 4deg)&lt;/code&gt; instead of &lt;code&gt;random(-4deg, 4deg)&lt;/code&gt;. Run the visual checks at &lt;code&gt;fixed 0&lt;/code&gt; and &lt;code&gt;fixed 1&lt;/code&gt; as well, because the extremes of the range are exactly where overlap bugs live.&lt;/p&gt;

&lt;h2&gt;
  
  
  Capture the value, not just the picture
&lt;/h2&gt;

&lt;p&gt;A screenshot shows that something overlapped. It does not tell you which random value produced it. What does is the size the element actually ended up with, which &lt;code&gt;getComputedStyle&lt;/code&gt; reports for layout properties like &lt;code&gt;width&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;cards&lt;/span&gt; &lt;span class="o"&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="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'.card'&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="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&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="n"&gt;el&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="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;getComputedStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&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;p&gt;Attach that to the bug report alongside the screenshot, and you can reproduce the layout by setting the same sizes, instead of reloading until chance agrees with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;Most "cannot reproduce" reports are about state the developer does not have: a cookie, an extension, a slower network. &lt;code&gt;random()&lt;/code&gt; adds a new kind, state that nobody has, because it was generated for that one page view and discarded. The only fix is to record it when the report is made, or to make it deterministic before anybody needs to.&lt;/p&gt;

&lt;p&gt;Browser support beyond Firefox 161 is not covered here; check it before relying on any of this in production.&lt;/p&gt;

</description>
      <category>css</category>
      <category>firefox</category>
      <category>testing</category>
      <category>frontend</category>
    </item>
    <item>
      <title>"ResizeObserver Loop Completed With Undelivered Notifications" Has No Stack Trace Because It Was Never Thrown</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Tue, 24 Nov 2026 13:57:56 +0000</pubDate>
      <link>https://dev.to/session_replay/resizeobserver-loop-completed-with-undelivered-notifications-has-no-stack-trace-because-it-was-1pm6</link>
      <guid>https://dev.to/session_replay/resizeobserver-loop-completed-with-undelivered-notifications-has-no-stack-trace-because-it-was-1pm6</guid>
      <description>&lt;p&gt;If your error tracker has a top ten, this message is probably in it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ResizeObserver loop completed with undelivered notifications.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No stack trace. No file, or a file that points at nothing useful. Thousands of occurrences, no user ever complaining. Most teams eventually add it to an ignore list and move on, and most of the time that is the right call. The trouble is the time it is not, and the ignore list cannot tell the difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nothing threw it
&lt;/h2&gt;

&lt;p&gt;The message is not an exception from your code or from a library. It is defined, word for word, in the Resize Observer specification, in an algorithm called "deliver resize loop error notification":&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create a new ErrorEvent. Initialize event's message slot to "ResizeObserver loop completed with undelivered notifications.". Report the exception event.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the whole algorithm. The browser builds an error event, sets its message and nothing else, and reports it the way it reports an uncaught exception. Which is why it reaches &lt;code&gt;window.onerror&lt;/code&gt; and every error tracker that hooks it, and why it arrives with no stack: there was never an &lt;code&gt;Error&lt;/code&gt; object, so there was never a stack to capture. The tracker is faithfully recording a sentence the browser wrote.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the browser writes it
&lt;/h2&gt;

&lt;p&gt;Resize observations are delivered as part of rendering a frame. The spec's algorithms gather the elements whose size changed, call your callbacks, and then check again, because your callback may itself have changed sizes. To guarantee the frame finishes, each further round only delivers changes for elements deeper in the tree than the shallowest one it just delivered. Anything else that changed is skipped for that frame. If something was skipped, the browser reports the message above.&lt;/p&gt;

&lt;p&gt;So the message means: during this frame, a resize callback changed the size of something at the same level or above the element it was observing, and the browser declined to go round again.&lt;/p&gt;

&lt;p&gt;The everyday version is harmless. A component measures itself in a resize callback, sets a height, and that height change lands one frame later instead of this one. Nobody sees it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The version that is not harmless
&lt;/h2&gt;

&lt;p&gt;The same message is what you get when a callback and the layout chase each other: the callback sets a width, the new width changes the observed size, the callback sets it back. Every frame skips something and reports the message, and on screen the element flickers, jitters, or a scrollbar appears and disappears.&lt;/p&gt;

&lt;p&gt;That is a real bug a user can see and report. "The sidebar shakes." "The page keeps jumping on my laptop." From your side it looks like nothing, because the only signal it produced was the one message you taught your tracker to throw away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ignore it, but count it
&lt;/h2&gt;

&lt;p&gt;Filtering it out entirely trades noise for blindness. A cheap middle ground is to stop it reaching the tracker as an error and keep its rate instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;resizeLoopCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'error'&lt;/span&gt;&lt;span class="p"&gt;,&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="o"&gt;=&amp;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;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'ResizeObserver loop'&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="n"&gt;resizeLoopCount&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;
    &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stopImmediatePropagation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// keep it out of the error tracker&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="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// send resizeLoopCount with your other page metrics, per page and per session&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A page that produces it a handful of times per visit is doing the harmless thing. A page that produces it on every frame for as long as it is open has a feedback loop, and now you can see which page.&lt;/p&gt;

&lt;p&gt;Register that listener before the tracker's own, or the tracker sees the event first.&lt;/p&gt;

&lt;p&gt;When you find the loop, the usual fix is to stop changing size synchronously inside the callback: move the write into the next frame with &lt;code&gt;requestAnimationFrame&lt;/code&gt;, or compare against the last size you set and do nothing if it has not really changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;An error message without a stack trace is often not an error at all, but a report the platform wrote about something it noticed. Those deserve to be read rather than suppressed: they are telling you what the browser saw, which is more than the user can usually say.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>css</category>
      <category>errors</category>
    </item>
    <item>
      <title>A Revoked Certificate Breaks Your Site in Firefox First. Chrome Can Take Days.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Mon, 23 Nov 2026 13:57:41 +0000</pubDate>
      <link>https://dev.to/session_replay/a-revoked-certificate-breaks-your-site-in-firefox-first-chrome-can-take-days-5aj1</link>
      <guid>https://dev.to/session_replay/a-revoked-certificate-breaks-your-site-in-firefox-first-chrome-can-take-days-5aj1</guid>
      <description>&lt;p&gt;This morning a certificate authority, SECOM, filed a preliminary incident report in Mozilla's CA program: serial numbers from fifteen of its issuing CAs could be reproduced, because they came from Java's SHA1PRNG seeded with a value derived from the CA system's startup time. At least 116,740 affected certificates are still valid. What happens to them, SECOM says, will be in its full report. It has not said they will be revoked.&lt;/p&gt;

&lt;p&gt;Whatever SECOM decides, it is a good moment to know something most developers find out from a bug report: &lt;strong&gt;when a certificate is revoked, browsers do not find out at the same time.&lt;/strong&gt; For a while, the same site is broken in one browser and fine in another.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Firefox finds out
&lt;/h2&gt;

&lt;p&gt;Since Firefox 137, Firefox on desktop has used a mechanism called CRLite. Mozilla's description: Firefox "periodically downloads a compact encoding of the set of all revoked certificates that appear in Certificate Transparency logs", "updates it every 12 hours, and queries it privately every time a new TLS connection is created".&lt;/p&gt;

&lt;p&gt;So every revocation, for every certificate in the public logs, reaches desktop Firefox within about half a day.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Chrome finds out
&lt;/h2&gt;

&lt;p&gt;Chrome's security FAQ answers this directly. Its "primary mechanism for checking certificate revocation status is CRLSets", it honours stapled OCSP responses, and by default it does not perform "online" revocation checks at all. On coverage and timing it is careful: Chrome "enforces most security-relevant certificate revocations", and "most revocations should reach most users within a few days of appearing on a CA's CRL".&lt;/p&gt;

&lt;p&gt;Two qualifiers in there matter: &lt;em&gt;most&lt;/em&gt;, and &lt;em&gt;security-relevant&lt;/em&gt;. Whether a particular revocation reaches Chrome, and when, is Chrome's call.&lt;/p&gt;

&lt;h2&gt;
  
  
  What that looks like from the outside
&lt;/h2&gt;

&lt;p&gt;A certificate is revoked on Tuesday morning. By Tuesday evening, Firefox users on desktop can be getting a certificate error on your site. Chrome users, very often including the developer looking into it, may see nothing wrong for days.&lt;/p&gt;

&lt;p&gt;So the bug report reads "your site says it's not secure", the developer opens it in Chrome, it loads, and the report is closed as something on the user's machine. For days it really does look like one person's problem, because that is how the information is distributed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking it yourself in two minutes
&lt;/h2&gt;

&lt;p&gt;You do not need to wait for a browser to tell you. Pull the certificate the site is actually serving, then ask its CA's own revocation list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;example.com
openssl s_client -connect &lt;span class="s2"&gt;"$host:443"&lt;/span&gt; -servername &lt;span class="s2"&gt;"$host"&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null \
  &lt;span class="o"&gt;|&lt;/span&gt; openssl x509 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; cert.pem

openssl x509 -in cert.pem -noout -issuer -serial
openssl x509 -in cert.pem -noout -ext crlDistributionPoints
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last line prints the URL of the issuer's CRL. Download it and look for your serial:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s -o ca.crl &lt;span class="s2"&gt;"http://the-url-from-above.crl"&lt;/span&gt;
openssl crl -inform DER -in ca.crl -noout -text &lt;span class="o"&gt;|&lt;/span&gt; grep -i &lt;span class="s2"&gt;"&amp;lt;serial from above&amp;gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No output means your certificate is not on that list. A match means it is revoked, whatever Chrome is currently showing you. (I ran this against a Let's Encrypt certificate while writing: the CRL held 2,359 revoked serials, in the same hex format &lt;code&gt;openssl x509 -serial&lt;/code&gt; prints, so a plain grep works.)&lt;/p&gt;

&lt;p&gt;The first command alone is worth running today if you are anywhere near the SECOM news: &lt;code&gt;-issuer&lt;/code&gt; tells you which CA signed your certificate, and the report lists the affected issuing CAs by name.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;"It works in Chrome" is evidence about Chrome's state, not about your site's. Certificate revocation is one of the few failures where the browsers disagree by design, on a schedule, and between these two the disagreement runs in one direction: Firefox first. (I have not checked how Safari behaves, so do not read this as covering it.)&lt;/p&gt;

&lt;p&gt;When a certificate error arrives from one browser and not another, ask which browser and when, and check the revocation list before deciding it is their machine.&lt;/p&gt;

</description>
      <category>security</category>
      <category>firefox</category>
      <category>chrome</category>
      <category>ssl</category>
    </item>
    <item>
      <title>Your End-to-End Tests Run a Chrome With Popup Blocking and Background Throttling Turned Off</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Fri, 20 Nov 2026 13:57:39 +0000</pubDate>
      <link>https://dev.to/session_replay/your-end-to-end-tests-run-a-chrome-with-popup-blocking-and-background-throttling-turned-off-46l5</link>
      <guid>https://dev.to/session_replay/your-end-to-end-tests-run-a-chrome-with-popup-blocking-and-background-throttling-turned-off-46l5</guid>
      <description>&lt;p&gt;A user reports a bug. You write a Playwright or Puppeteer test that does exactly what they did. It passes. You close the report.&lt;/p&gt;

&lt;p&gt;Before you do, look at how your test runner starts Chrome, because it is not the way your user starts it. Both tools launch the browser with a list of default switches, and several of those switches turn off the precise behaviours that produce bugs users report and developers cannot reproduce.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the defaults are
&lt;/h2&gt;

&lt;p&gt;From Puppeteer's &lt;code&gt;ChromeLauncher.ts&lt;/code&gt; and Playwright's &lt;code&gt;chromiumSwitches.ts&lt;/code&gt;, current &lt;code&gt;main&lt;/code&gt; of each:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Both of them&lt;/strong&gt; pass &lt;code&gt;--disable-popup-blocking&lt;/code&gt;, &lt;code&gt;--disable-prompt-on-repost&lt;/code&gt;, &lt;code&gt;--disable-background-timer-throttling&lt;/code&gt;, &lt;code&gt;--disable-backgrounding-occluded-windows&lt;/code&gt; and &lt;code&gt;--disable-renderer-backgrounding&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Playwright also&lt;/strong&gt; passes &lt;code&gt;--disable-extensions&lt;/code&gt; and &lt;code&gt;--disable-back-forward-cache&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Puppeteer also&lt;/strong&gt; passes &lt;code&gt;--enable-automation&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Every one of those is a reasonable choice for a test runner. A suite needs to be deterministic, and a browser that blocks a popup sometimes, throttles a timer sometimes and restores a page from cache sometimes is not. The trouble is only that your users get the "sometimes".&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug each one hides
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--disable-popup-blocking&lt;/code&gt;.&lt;/strong&gt; Chrome lets a page open a window in response to a click. A &lt;code&gt;window.open&lt;/code&gt; that runs after an &lt;code&gt;await&lt;/code&gt;, once the click has been used up, is the classic one that works in development and is blocked in the field. With popup blocking off, it is never blocked in your tests either.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--disable-prompt-on-repost&lt;/code&gt;.&lt;/strong&gt; The "Confirm Form Resubmission" dialog, which a user meets when they reload or go back to a page that was the result of a POST, does not appear. Whatever your page does after it is untested.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The three background switches.&lt;/strong&gt; Chromium's own description of &lt;code&gt;--disable-background-timer-throttling&lt;/code&gt; is "Disable task throttling of timer tasks from background pages", and of &lt;code&gt;--disable-renderer-backgrounding&lt;/code&gt; that renderers "are never told that they are backgrounded or hidden" at the operating system level. A user with your app in a background tab gets a &lt;code&gt;setInterval&lt;/code&gt; that fires far less often than you asked. Your test gets the interval you wrote.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--disable-back-forward-cache&lt;/code&gt;&lt;/strong&gt; (Playwright). The back-forward cache restores a page exactly as the user left it when they press Back, without running your load code again. That is where "I pressed Back and the basket showed the old total" comes from. Playwright's source gives its reason in a comment: it "Avoids surprises like main request not being intercepted during page.goBack()". Sensible for a test, and it means no Playwright test of yours has ever met a page restored from that cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--disable-extensions&lt;/code&gt;&lt;/strong&gt; (Playwright). No ad blocker, no privacy extension, no password manager. The requests those block, and the DOM they change, are not in your test's world, and they are in most of your users'.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;--enable-automation&lt;/code&gt;&lt;/strong&gt; (Puppeteer). This one switches off something specific. Chrome normally reloads a network error page by itself, after one second, then five, then thirty, and the code that installs that behaviour checks for this switch and leaves it out when it is present. A user sees an error flash and go away. Your test sees it stay.&lt;/p&gt;

&lt;p&gt;And under all of these, a fresh profile: no saved passwords, no cookies from last month, no history. That on its own is the difference between a login form a returning user sees already filled in and the empty one your test types into.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do about it
&lt;/h2&gt;

&lt;p&gt;Keep the defaults for the bulk of the suite. The determinism is worth it.&lt;/p&gt;

&lt;p&gt;Then add a small set of tests that run a Chrome closer to your users', for the specific behaviours your app depends on. Both tools take an &lt;code&gt;ignoreDefaultArgs&lt;/code&gt; option that removes named switches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Playwright&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;browser&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;chromium&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;ignoreDefaultArgs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'--disable-back-forward-cache'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'--disable-popup-blocking'&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="c1"&gt;// Puppeteer&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;browser&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;puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;ignoreDefaultArgs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'--disable-popup-blocking'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'--disable-background-timer-throttling'&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;p&gt;A test that opens a popup after an &lt;code&gt;await&lt;/code&gt;, one that presses Back on a page with state, one that leaves a timer running in a hidden tab: three tests, each aimed at a class of report you would otherwise close as "cannot reproduce".&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;"It passes in my test" is a statement about the browser your tool built, not the one your user has. When a report will not reproduce, the first thing worth comparing is not their steps against yours. It is their browser's configuration against your test runner's launch arguments, and the runner's list is printed in its own source.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>playwright</category>
      <category>puppeteer</category>
      <category>chrome</category>
    </item>
    <item>
      <title>The Login Form Is Filled In and Your Code Sees Empty Strings. Chrome Is Doing It on Purpose.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Thu, 19 Nov 2026 13:57:53 +0000</pubDate>
      <link>https://dev.to/session_replay/the-login-form-is-filled-in-and-your-code-sees-empty-strings-chrome-is-doing-it-on-purpose-2kmb</link>
      <guid>https://dev.to/session_replay/the-login-form-is-filled-in-and-your-code-sees-empty-strings-chrome-is-doing-it-on-purpose-2kmb</guid>
      <description>&lt;p&gt;The report goes something like this: "I open the login page, my email and password are already there, and the Sign in button is greyed out." You open the page. You type your test credentials. The button lights up. Closed, cannot reproduce.&lt;/p&gt;

&lt;p&gt;The reporter was right, and so was your test. They had a saved password. You did not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Chrome does with a saved password on page load
&lt;/h2&gt;

&lt;p&gt;When Chrome's password manager fills a login form as the page loads, it does not put the values into the fields. Chromium's own source is explicit about it, in &lt;code&gt;password_autofill_agent.h&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;On page load, PWM preliminarily autofills usernames and passwords in a way that keeps them inaccessible to JavaScript using SetSuggestedValue() and WebAutofillState::kAutofilled.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the class that enforces it, &lt;code&gt;PasswordValueGatekeeper&lt;/code&gt;, exists to ensure "that the autofilled values are not accessible to JavaScript code until the user interacts with the page". The comment gives the reasons as privacy and attack surface, and links the two Chromium bugs behind it.&lt;/p&gt;

&lt;p&gt;So for that window, the user sees both fields filled and your code reads this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;emailInput&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;     &lt;span class="c1"&gt;// ""&lt;/span&gt;
&lt;span class="n"&gt;passwordInput&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;  &lt;span class="c1"&gt;// ""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both of them, not just the password. The gatekeeper registers "every autofilled username and password field".&lt;/p&gt;

&lt;h2&gt;
  
  
  What a page built on the obvious pattern does with that
&lt;/h2&gt;

&lt;p&gt;Any code that reads the fields once and decides something gets the wrong answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Sign in button that starts disabled and is enabled by checking the values on load.&lt;/li&gt;
&lt;li&gt;A "Continue" step that validates on load and shows "Password is required" under a field that visibly contains one.&lt;/li&gt;
&lt;li&gt;A framework store initialised from the DOM, which now holds two empty strings and will not look again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this happens in a clean test profile, because there is nothing saved to fill. It does not happen in Playwright or Cypress either, because the browsers they drive start with no saved passwords. It happens to returning users with saved passwords, which is to say the people most likely to be logging in at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the values arrive, and what fires
&lt;/h2&gt;

&lt;p&gt;The first time the user interacts with the page, the gatekeeper calls &lt;code&gt;ShowValue&lt;/code&gt; on each field it held back, and that calls &lt;code&gt;SetAutofillValue&lt;/code&gt;. In Blink's &lt;code&gt;web_form_control_element.cc&lt;/code&gt; that function does more than set a value. For a field without focus it dispatches a &lt;code&gt;focus&lt;/code&gt; event, then a synthetic &lt;code&gt;keydown&lt;/code&gt; ("in case the website checks via JS that a keyboard interaction took place", says the comment), then sets the value, which sends &lt;code&gt;input&lt;/code&gt; and &lt;code&gt;change&lt;/code&gt;, then &lt;code&gt;keyup&lt;/code&gt;, then &lt;code&gt;blur&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That sequence is the whole fix, if your code is listening for it. A button whose state is recomputed on every &lt;code&gt;input&lt;/code&gt; event recovers the moment the user clicks anywhere. One whose state was computed once on load does not, and since a disabled button does not dispatch &lt;code&gt;click&lt;/code&gt; to your handler, the user can press it all day.&lt;/p&gt;

&lt;p&gt;The synthetic &lt;code&gt;focus&lt;/code&gt; and &lt;code&gt;blur&lt;/code&gt; are worth knowing about as well. Validation that marks a field as touched on blur will consider both fields touched before the user has looked at them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Telling "empty" from "filled, not yet released"
&lt;/h2&gt;

&lt;p&gt;The field is in an autofilled state before its value is exposed, and CSS can see that state. In Blink, &lt;code&gt;:autofill&lt;/code&gt; (and the older &lt;code&gt;:-webkit-autofill&lt;/code&gt;) match when the field &lt;code&gt;IsAutofilled()&lt;/code&gt;, which is exactly the state the preliminary fill sets. So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;looksEmptyButIsnt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;':autofill'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;':-webkit-autofill'&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;p&gt;Use it to avoid showing an error, not to read the password. The value stays out of reach until the user acts, by design, and nothing on the page should try to get round that.&lt;/p&gt;

&lt;p&gt;The simpler fix is not to gate the button at all. Leave Sign in enabled and validate on submit. By the time anybody submits, they have clicked or pressed a key, the gatekeeper has released the values, and your validation sees what the user sees.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;This is the shape of a lot of "cannot reproduce" closures: the state that triggers the bug is something the user has and the developer's test setup is built not to have. Saved passwords, an installed extension, a cookie from last month. If a report says the form was already filled in, believe that sentence before anything else in it.&lt;/p&gt;

&lt;p&gt;Behaviour described here is Chrome's, from Chromium's source. I have not checked what other browsers do in the same window, so test those separately rather than assuming.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>chrome</category>
      <category>forms</category>
      <category>security</category>
    </item>
    <item>
      <title>Your Error Log Says `{}`. The Usual Fix Still Loses the Stack in Firefox.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Wed, 18 Nov 2026 13:58:39 +0000</pubDate>
      <link>https://dev.to/session_replay/your-error-log-says-the-usual-fix-still-loses-the-stack-in-firefox-3197</link>
      <guid>https://dev.to/session_replay/your-error-log-says-the-usual-fix-still-loses-the-stack-in-firefox-3197</guid>
      <description>&lt;p&gt;Somewhere in most front-end codebases there is a line like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'checkout failed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;err&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;p&gt;And somewhere in the log store there are a few hundred entries that read &lt;code&gt;checkout failed {"err":{}}&lt;/code&gt;. Nobody notices until the day a customer says the payment page broke, and the one record of what happened says nothing at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why an Error serialises to nothing
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;JSON.stringify&lt;/code&gt; only writes an object's own enumerable properties. The ECMAScript specification's Error constructor creates the message with &lt;code&gt;CreateNonEnumerableDataPropertyOrThrow(obj, "message", messageString)&lt;/code&gt;, and &lt;code&gt;cause&lt;/code&gt; is installed the same way. Non-enumerable, by design, so the message is invisible to &lt;code&gt;JSON.stringify&lt;/code&gt;, to &lt;code&gt;Object.keys&lt;/code&gt; and to spread. &lt;code&gt;stack&lt;/code&gt; is not in the specification at all, and every engine puts it somewhere different. That last part is where the usual fix comes apart.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix everybody copies
&lt;/h2&gt;

&lt;p&gt;The answer you find first is to pass the property names explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getOwnPropertyNames&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&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;p&gt;I ran it in Chrome 157, Firefox 146 and the JavaScriptCore engine that ships with macOS, on &lt;code&gt;new Error('Payment failed', { cause: { code: 402 } })&lt;/code&gt;. Three different results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chrome:&lt;/strong&gt; &lt;code&gt;stack&lt;/code&gt;, &lt;code&gt;message&lt;/code&gt;, &lt;code&gt;cause&lt;/code&gt;. The stack survives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JavaScriptCore:&lt;/strong&gt; &lt;code&gt;message&lt;/code&gt;, &lt;code&gt;cause&lt;/code&gt;, &lt;code&gt;line&lt;/code&gt;, &lt;code&gt;column&lt;/code&gt;, &lt;code&gt;sourceURL&lt;/code&gt;, &lt;code&gt;stack&lt;/code&gt;. The stack survives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Firefox:&lt;/strong&gt; &lt;code&gt;fileName&lt;/code&gt;, &lt;code&gt;lineNumber&lt;/code&gt;, &lt;code&gt;columnNumber&lt;/code&gt;, &lt;code&gt;message&lt;/code&gt;, &lt;code&gt;cause&lt;/code&gt;. &lt;strong&gt;No stack.&lt;/strong&gt; In Firefox, &lt;code&gt;stack&lt;/code&gt; is an accessor on &lt;code&gt;Error.prototype&lt;/code&gt;, not a property of the error, so &lt;code&gt;getOwnPropertyNames&lt;/code&gt; never lists it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the same line gives you a stack trace for Chrome users and a file name and line number for Firefox users, and whichever browser you test in decides which one you think you have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two more holes in it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The cause comes back empty in every engine.&lt;/strong&gt; In all three, the &lt;code&gt;cause&lt;/code&gt; above serialised as &lt;code&gt;{}&lt;/code&gt;. A replacer array is not a list of keys for the top-level object. The specification's &lt;code&gt;SerializeJSONObject&lt;/code&gt; uses it as the key list at &lt;em&gt;every&lt;/em&gt; level, so the nested object is filtered to keys named &lt;code&gt;stack&lt;/code&gt;, &lt;code&gt;message&lt;/code&gt; and so on, and &lt;code&gt;{ code: 402 }&lt;/code&gt; has none of them. The one field that said why the payment failed is the one that disappears.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A DOMException gives you nothing at all.&lt;/strong&gt; &lt;code&gt;AbortError&lt;/code&gt;, &lt;code&gt;NotAllowedError&lt;/code&gt;, &lt;code&gt;QuotaExceededError&lt;/code&gt; and the rest are DOMExceptions, and their &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;message&lt;/code&gt; are Web IDL attributes, which live as accessors on the prototype. On &lt;code&gt;new DOMException('The user aborted a request.', 'AbortError')&lt;/code&gt;, &lt;code&gt;getOwnPropertyNames&lt;/code&gt; returned an empty array in both Chrome and Firefox, and the "fixed" stringify returned &lt;code&gt;{}&lt;/code&gt;. In Firefox, the abort reason from a real &lt;code&gt;AbortController&lt;/code&gt; did the same. Chrome's own abort reason carries an own &lt;code&gt;stack&lt;/code&gt;, so there you get the stack text and nothing else.&lt;/p&gt;

&lt;p&gt;That is the class of failure most worth reading in a front-end log: storage quota, a permission refused, a request cancelled. They are the ones serialised to &lt;code&gt;{}&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to log instead
&lt;/h2&gt;

&lt;p&gt;Read the properties by name. A getter works fine when you ask for it directly; it is only enumeration that skips it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;describeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&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;err&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'object'&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="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;thrown&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;            &lt;span class="c1"&gt;// someone threw a string&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="k"&gt;typeof&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'string'&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="n"&gt;err&lt;/span&gt;                                &lt;span class="c1"&gt;// a plain object as cause: keep it as is&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;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stack&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;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code&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;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cause&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cause&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;describeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cause&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;depth&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&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="n"&gt;out&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'checkout failed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;describeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&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;p&gt;On the same three inputs this gives the stack in Firefox, the &lt;code&gt;{ code: 402 }&lt;/code&gt; cause intact, and &lt;code&gt;AbortError&lt;/code&gt; with its message for the DOMException. The &lt;code&gt;depth&lt;/code&gt; limit is there because a cause chain can point back at itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;A log line is a bug report written by your code instead of a person, and it fails the same way a person's does: it records what was easy to record, not what you will need. The time to find out that it says &lt;code&gt;{}&lt;/code&gt; is before the incident, so pick one &lt;code&gt;catch&lt;/code&gt; block today, throw a DOMException through it in Firefox, and read what lands in the log.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>firefox</category>
      <category>logging</category>
      <category>errors</category>
    </item>
    <item>
      <title>Your Bug Report Says "iPhone". The Screen Is 448 by 364.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Tue, 17 Nov 2026 13:58:17 +0000</pubDate>
      <link>https://dev.to/session_replay/your-bug-report-says-iphone-the-screen-is-448-by-364-4hni</link>
      <guid>https://dev.to/session_replay/your-bug-report-says-iphone-the-screen-is-448-by-364-4hni</guid>
      <description>&lt;p&gt;Last Friday Safari arrived on a new device: Apple HomeView, which has a square 7-inch display that people mostly use with their voice. WebKit's announcement includes a line that will produce a particular kind of bug report for the next year:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Safari on HomeView also reports an iOS user agent.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the report will say "iOS Safari". You will pick up an iPhone, open the page, and it will be fine. Not because the bug is not real, but because the report described the wrong thing. It classified the device, and the device class is the one fact that does not decide how a page renders.&lt;/p&gt;

&lt;h2&gt;
  
  
  A user agent is a claim. A viewport is a measurement.
&lt;/h2&gt;

&lt;p&gt;Everything about how your layout behaves is decided by a handful of numbers the browser can measure directly: the width and height of the viewport, whether the primary pointer is precise, whether it can hover. The user agent is a string that a vendor chose, and on HomeView it says iOS.&lt;/p&gt;

&lt;p&gt;WebKit is specific about what that hides. The screen is square, and "Some sites assume the viewport is always taller than 600px, while on HomeView it’s shorter." Its suggested test size is 448 by 364. Put a sticky header and a sticky footer on that and there is very little page left between them. Put a newsletter modal on it that is taller than the viewport, and its close button can sit below the bottom of the screen with no way to scroll to it.&lt;/p&gt;

&lt;p&gt;None of that is in the words "iOS Safari".&lt;/p&gt;

&lt;h2&gt;
  
  
  Record the screen, not the category
&lt;/h2&gt;

&lt;p&gt;The fix for the report is small. Capture what the page actually had to work with, at the moment it went wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;describeScreen&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;vv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;visualViewport&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;viewport&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`${window.innerWidth}x${window.innerHeight}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;visualViewport&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;vv&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="sb"&gt;`${Math.round(vv.width)}x${Math.round(vv.height)} @ ${vv.scale}`&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;devicePixelRatio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;devicePixelRatio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'(pointer: fine)'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;matches&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'fine'&lt;/span&gt;
           &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'(pointer: coarse)'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;matches&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'coarse'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'none'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'(hover: hover)'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;orientation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orientation&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orientation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;userAgent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;userAgent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// still worth keeping, just not trusting&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;p&gt;The media features are not guesses. The Media Queries specification defines &lt;code&gt;pointer&lt;/code&gt; as reflecting "the characteristics of the “primary” pointing device, as determined by the user agent", and &lt;code&gt;coarse&lt;/code&gt; as "a pointing device of limited accuracy. Examples include touchscreens". &lt;code&gt;hover&lt;/code&gt; is defined the same way, for the ability to hover over elements with that primary pointer. They answer the question your CSS is actually asking, which is why they are the thing to log.&lt;/p&gt;

&lt;p&gt;Do not assume what any of them will say on HomeView. WebKit's post does not tell you, and the point of measuring is that you no longer need to be told.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce with the numbers, not the device
&lt;/h2&gt;

&lt;p&gt;Once a report carries &lt;code&gt;448x364&lt;/code&gt;, you do not need the device. Responsive design mode in any browser will give you that viewport, and WebKit's own advice for anybody without the hardware is the same idea: "test your site on a phone in landscape orientation", which is short in the same way.&lt;/p&gt;

&lt;p&gt;Without the numbers, you are guessing at a device from a string that, on this device, names the wrong one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general version
&lt;/h2&gt;

&lt;p&gt;HomeView is just the cleanest recent example of an old problem. Device names are categories, and categories are how people describe what they were holding. Layout bugs live in the dimensions, the input method and the zoom level, and none of those survive the trip into "it's broken on my iPhone" unless something captured them before the person started typing.&lt;/p&gt;

&lt;p&gt;Ask for the numbers, or collect them. Treat "iPhone" in a report as the beginning of a question, not the answer to one.&lt;/p&gt;

</description>
      <category>css</category>
      <category>javascript</category>
      <category>ios</category>
      <category>ux</category>
    </item>
    <item>
      <title>Your Old Certificate Works in Firefox and the Renewed One Does Not. Here Is the Line That Decides.</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Mon, 16 Nov 2026 13:58:08 +0000</pubDate>
      <link>https://dev.to/session_replay/your-old-certificate-works-in-firefox-and-the-renewed-one-does-not-here-is-the-line-that-decides-maf</link>
      <guid>https://dev.to/session_replay/your-old-certificate-works-in-firefox-and-the-renewed-one-does-not-here-is-the-line-that-decides-maf</guid>
      <description>&lt;p&gt;Picture the report. A Firefox user says your site shows a certificate warning. You open it in your browser and it is fine. You check the server and nothing has changed in months, except that the certificate renewed itself last week, which it does every few months without anybody looking.&lt;/p&gt;

&lt;p&gt;Last week Mozilla shipped, and then reversed, a change that makes this report possible for real sites. The interesting part is not the incident. It is the mechanism, because it means a certificate can be refused for its birthday.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&gt;

&lt;p&gt;DigiCert's transition plan asked for its Trusted Root G4 to stop being trusted for websites. Mozilla made the change in NSS, the certificate library Firefox uses, with the note "Changes made in NSS 3.134 and FF 162". It then received "preliminary indications of TLS connection failures" on the site of a German bank, DKB, and on 13 November it changed course.&lt;/p&gt;

&lt;p&gt;The commit that went in instead is short. Here is the relevant part of the diff to &lt;code&gt;certdata.txt&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE&lt;/span&gt;
&lt;span class="gi"&gt;+# For Server Distrust After: Mon Sep 14 23:59:59 2026&lt;/span&gt;
&lt;span class="gi"&gt;+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL&lt;/span&gt;
&lt;span class="gi"&gt;+\062\066\060\071\061\064\062\063\065\071\065\071\132&lt;/span&gt;
&lt;span class="gi"&gt;+END&lt;/span&gt;
&lt;span class="gd"&gt;-CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST&lt;/span&gt;
&lt;span class="gi"&gt;+CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The root is trusted for websites again, with a date attached. Mozilla's reviewer counted 148 unexpired certificates still chaining to that root, which is why a hard cut broke things and a date did not. Firefox 162 is two releases ahead of the 160 that shipped last week, so release users never saw the broken version.&lt;/p&gt;

&lt;h2&gt;
  
  
  The line that decides
&lt;/h2&gt;

&lt;p&gt;A distrust-after date does not mean "stop trusting this root after this day". It means something narrower, and the narrowness is the hazard. In Firefox's &lt;code&gt;NSSCertDBTrustDomain.cpp&lt;/code&gt; the check ends like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="nc"&gt;Time&lt;/span&gt; &lt;span class="n"&gt;distrustAfterTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;mozilla&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;pkix&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;TimeFromEpochInSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distrustAfter&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="no"&gt;PR_USEC_PER_SEC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;distrustAfterTimeOut&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emplace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;distrustAfterTime&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;endEntityNotBefore&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;distrustAfterTime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;isDistrusted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&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;p&gt;&lt;code&gt;endEntityNotBefore&lt;/code&gt; is the issue date of your certificate, the leaf, not the root's or the intermediate's, and not today's date. A certificate issued before the cutoff stays trusted until it expires. A certificate issued after it, from the same CA, through the same intermediate, for the same domain, is refused.&lt;/p&gt;

&lt;p&gt;So on the day your renewal runs, nothing about your server changes except one date in one field, and Firefox's answer flips.&lt;/p&gt;

&lt;p&gt;It is not easy to talk your way round either. In &lt;code&gt;MultiLogCTVerifier.cpp&lt;/code&gt;, the Certificate Transparency timestamps a certificate carries are checked against the same date:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// If the root has a distrustAfter time, ensure that the SCT's timestamp is&lt;/span&gt;
&lt;span class="c1"&gt;// not after that time.&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;distrustAfterTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isSome&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;sctTime&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;distrustAfterTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;value&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="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sctsWithDistrustedTimestamps&lt;/span&gt;&lt;span class="o"&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;Success&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;p&gt;The logs' own clock is consulted, not just the date the CA wrote on the certificate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is invisible from your desk
&lt;/h2&gt;

&lt;p&gt;Every check you are likely to run first says the site is fine.&lt;/p&gt;

&lt;p&gt;Your own browser may not be Firefox, and each browser keeps its own list of trusted roots with its own rules attached. A monitoring probe or a script runs on whatever trust store its own runtime ships with. Your previous certificate, the one you tested when you set this up, was issued before the cutoff. None of those can see a rule that depends on the issue date of a certificate you have not looked at since it renewed.&lt;/p&gt;

&lt;p&gt;And the report itself will not help. "Firefox says the connection is not secure" is the same sentence for an expired certificate, a wrong clock on their laptop, a corporate proxy, and this. The difference is in which root the chain ends at and when the leaf was issued, and the person reporting it has no reason to know either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking your own chain
&lt;/h2&gt;

&lt;p&gt;Two questions, and both have one-line answers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Which root does the chain end at? Read the last issuer.&lt;/span&gt;
openssl s_client -connect example.com:443 -servername example.com -showcerts &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null \
  &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'^ *[0-9] s:|i:'&lt;/span&gt;

&lt;span class="c"&gt;# When was the certificate you are serving issued?&lt;/span&gt;
openssl s_client -connect example.com:443 -servername example.com &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null \
  &lt;span class="o"&gt;|&lt;/span&gt; openssl x509 -noout -startdate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the chain ends at a root with a distrust-after date and &lt;code&gt;notBefore&lt;/code&gt; is later than it, Firefox will refuse it once that rule is in the release a user is running, and nothing on your side will have changed. The fix is not on the server. It is a certificate issued under a different root.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to take from it
&lt;/h2&gt;

&lt;p&gt;A certificate warning in one browser only is a question about that browser's root store before it is a question about your server. Ask which browser and version, look at which root your chain ends at, and look at when the certificate was issued. Renewal automation is the thing most likely to move that last date without anybody noticing, and a distrust-after rule is the thing that makes the date matter.&lt;/p&gt;

</description>
      <category>security</category>
      <category>firefox</category>
      <category>tls</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A CORS Error on a POST Does Not Mean the POST Failed</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Fri, 13 Nov 2026 13:58:17 +0000</pubDate>
      <link>https://dev.to/session_replay/a-cors-error-on-a-post-does-not-mean-the-post-failed-8ed</link>
      <guid>https://dev.to/session_replay/a-cors-error-on-a-post-does-not-mean-the-post-failed-8ed</guid>
      <description>&lt;p&gt;Somebody clicks Pay. The console says the request was blocked by CORS policy, the button says something went wrong, and they click it again.&lt;/p&gt;

&lt;p&gt;Did you just charge them twice, or not at all? The answer depends on a header you probably did not choose on purpose, and nothing your JavaScript received can tell you which.&lt;/p&gt;

&lt;h2&gt;
  
  
  "The browser blocked the request" is half right
&lt;/h2&gt;

&lt;p&gt;That is how CORS errors usually get explained, and for one kind of request it is true. For the other kind, the request went out, the server ran it, and the only thing the browser blocked was your script reading the answer.&lt;/p&gt;

&lt;p&gt;The Fetch Standard is explicit about the order. In the step that actually goes to the network:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Set response and internalResponse to the result of running HTTP-network-or-cache fetch given fetchParams. If request’s response tainting is "cors" and a CORS check for request and response returns failure, then return a network error.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The fetch happens first. The check is applied to a response that has already come back, from a server that has already done whatever the request asked. A failed check discards the response. It cannot undo the work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which kind of request you sent
&lt;/h2&gt;

&lt;p&gt;Some cross-origin requests get a preflight first: an &lt;code&gt;OPTIONS&lt;/code&gt; request asking permission before the real one is sent. When the preflight fails, the spec returns the network error at that point, and the real request never leaves the browser. Nothing was written.&lt;/p&gt;

&lt;p&gt;Others skip the preflight entirely. The spec's rule is that a preflight is needed when the method is not a CORS-safelisted method, or when there is a header that is not safelisted. The safelisted methods are &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;HEAD&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;. For &lt;code&gt;Content-Type&lt;/code&gt;, only three values pass: &lt;code&gt;application/x-www-form-urlencoded&lt;/code&gt;, &lt;code&gt;multipart/form-data&lt;/code&gt; and &lt;code&gt;text/plain&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now look at what &lt;code&gt;fetch&lt;/code&gt; puts on a body you did not label. A string body gets &lt;code&gt;text/plain;charset=UTF-8&lt;/code&gt;, &lt;code&gt;URLSearchParams&lt;/code&gt; gets the form type, and &lt;code&gt;FormData&lt;/code&gt; gets multipart. All three are on the safelist.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// No preflight. This POST is sent, and the server handles it,&lt;/span&gt;
&lt;span class="c1"&gt;// whatever happens to the CORS check afterwards.&lt;/span&gt;
&lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://api.example.com/orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// Content-Type: text/plain;charset=UTF-8&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Preflighted. OPTIONS goes first. If it fails, this POST is never sent.&lt;/span&gt;
&lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://api.example.com/orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&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="p"&gt;{&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/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;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&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;p&gt;The first one is the easiest call to write and the one people write when they forget the header. Whether it writes anything depends on whether the server reads a body labelled &lt;code&gt;text/plain&lt;/code&gt;. Some frameworks ignore it; anything that parses the raw body will act on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your code cannot tell the two apart
&lt;/h2&gt;

&lt;p&gt;Both calls fail the same way. When the result is a network error, the spec says to reject the promise with a &lt;code&gt;TypeError&lt;/code&gt;. That is the same &lt;code&gt;TypeError&lt;/code&gt; a dropped connection produces, so &lt;code&gt;catch&lt;/code&gt; sees an identical error whether the order was written, half written, or never sent. The status code and the response body never reach your script.&lt;/p&gt;

&lt;p&gt;Which makes the obvious retry dangerous:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;placeOrder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&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;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&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="c1"&gt;// second order&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;p&gt;On a simple request with broken CORS, that is two orders and a user who saw two errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  And neither can the bug report
&lt;/h2&gt;

&lt;p&gt;The person reporting it says the same sentence either way: "it gave me an error, so I tried again." Their screen looked identical in both cases. Their description cannot distinguish a write that happened from one that did not, because they never saw anything that could.&lt;/p&gt;

&lt;p&gt;What can distinguish them is the network traffic. A preflight failure leaves an &lt;code&gt;OPTIONS&lt;/code&gt; request to that URL with no &lt;code&gt;POST&lt;/code&gt; after it. A simple request leaves a &lt;code&gt;POST&lt;/code&gt; that reached the server, which you can confirm in the server's own access log at that minute. One caveat: a successful earlier preflight can be cached, so a missing &lt;code&gt;OPTIONS&lt;/code&gt; in a capture is not proof on its own. The server log is the witness that cannot be wrong about whether the write arrived.&lt;/p&gt;

&lt;p&gt;So before anyone refunds, retries or replies "nothing went through", check the log.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do about it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Label JSON as JSON.&lt;/strong&gt; Setting &lt;code&gt;Content-Type: application/json&lt;/code&gt; forces the preflight, so a CORS misconfiguration fails before the server acts instead of after.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not retry a write on &lt;code&gt;TypeError&lt;/code&gt;.&lt;/strong&gt; It does not mean nothing happened. It means you do not know.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make writes idempotent.&lt;/strong&gt; An idempotency key on the request lets the server recognise the second attempt as the first one again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Triage a CORS report on a write as "unknown outcome", not "failed".&lt;/strong&gt; The browser said it would not show you the answer. It did not say there was no answer.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>api</category>
      <category>http</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Your input Handler Is Firing on Half a Character, and You Cannot Reproduce It</title>
      <dc:creator>Vladimir Elchinov</dc:creator>
      <pubDate>Wed, 11 Nov 2026 14:00:20 +0000</pubDate>
      <link>https://dev.to/session_replay/your-input-handler-is-firing-on-half-a-character-and-you-cannot-reproduce-it-4igk</link>
      <guid>https://dev.to/session_replay/your-input-handler-is-firing-on-half-a-character-and-you-cannot-reproduce-it-4igk</guid>
      <description>&lt;p&gt;A report comes in saying the search box "goes mad" while they type, or that the form will not accept their name, or that the character counter is wrong. You open the page, type the same thing, and everything is fine.&lt;/p&gt;

&lt;p&gt;They are using an input method editor. You are not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a composition session is
&lt;/h2&gt;

&lt;p&gt;An IME is how you type a language with more characters than keys. You type several keystrokes, the system shows a provisional string, and at some point you commit it and the real text lands. Japanese, Chinese and Korean most obviously, but the same machinery covers something far more common than that, which I will come back to.&lt;/p&gt;

&lt;p&gt;The W3C UI Events specification calls this a composition session, and describes it as "one compositionstart event, one or more compositionupdate events" and "one compositionend event".&lt;/p&gt;

&lt;p&gt;So far so reasonable. The part that breaks code is what happens &lt;em&gt;inside&lt;/em&gt; the session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your input listener fires on the provisional text
&lt;/h2&gt;

&lt;p&gt;Section 3.6.6 of the spec is titled "Input Events During Composition", and it sets the order: for each update, &lt;code&gt;beforeinput&lt;/code&gt;, then &lt;code&gt;compositionupdate&lt;/code&gt;, then &lt;code&gt;input&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;input&lt;/code&gt; fires repeatedly, during the session, carrying text the user has not committed and in many cases would not recognise as anything they typed.&lt;/p&gt;

&lt;p&gt;And then the sting, from the same section:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Since there are no DOM updates associated with the compositionend event, beforeinput and input events should not be sent at that time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read that twice if you have ever written &lt;code&gt;field.addEventListener('input', validate)&lt;/code&gt;. Your handler runs several times on provisional fragments, and then &lt;strong&gt;does not run at the moment the user finishes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The practical results are all the ones in that bug report. A validator rejecting a half-formed string. A character counter counting the wrong thing. A search-as-you-type sending a request per keystroke of a word that does not exist yet. An autosave storing a fragment.&lt;/p&gt;

&lt;h2&gt;
  
  
  The flag that fixes it
&lt;/h2&gt;

&lt;p&gt;Both &lt;code&gt;InputEvent&lt;/code&gt; and &lt;code&gt;KeyboardEvent&lt;/code&gt; carry &lt;code&gt;isComposing&lt;/code&gt;, defined as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;true if the input event occurs as part of a composition session,&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and, completing the sentence, "i.e., after a compositionstart event and before the corresponding compositionend event." Its uninitialized value "MUST be false", so on ordinary typing it is simply false and costs you nothing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;committed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;commit&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;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;committed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;   &lt;span class="c1"&gt;// the same commit, delivered twice&lt;/span&gt;
  &lt;span class="n"&gt;committed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;
  &lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;committed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'input'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isComposing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;          &lt;span class="c1"&gt;// provisional text, not a value yet&lt;/span&gt;
  &lt;span class="nf"&gt;commit&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="c1"&gt;// and because no input event is supposed to arrive at the end of a session:&lt;/span&gt;
&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'compositionend'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two listeners. The second one is the half people leave out, and leaving it out means an IME user's committed text is never processed at all.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;committed&lt;/code&gt; check is there because "supposed to" is doing work in that comment. The specification says that since &lt;code&gt;compositionend&lt;/code&gt; makes no change to the DOM, input events "should not be sent at that time". A reader reports that Safari sends one anyway, an &lt;code&gt;input&lt;/code&gt; carrying the committed value right after &lt;code&gt;compositionend&lt;/code&gt;, which without the check runs &lt;code&gt;handle&lt;/code&gt; twice for one commit. Guarding on the value costs nothing in a browser that follows the spec, and stops a side effect from happening twice in one that does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The advice you will find, and why it is wrong
&lt;/h2&gt;

&lt;p&gt;Search this problem and you will be told to check for &lt;code&gt;keyCode === 229&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That does appear in the specification. It appears in section 7.3.1, under a heading that says, in the document's own words, "This section is non-normative", in a legacy appendix describing one historical model. The same document says plainly:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Authors SHOULD use the key attribute instead of the charCode and keyCode attributes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It also notes that keyCode's values "are not normatively defined in this specification". So the famous number is not a rule, it is a description of what some implementations used to do. &lt;code&gt;isComposing&lt;/code&gt; is the attribute that is actually specified for this, and it is on the event you are already handling.&lt;/p&gt;

&lt;p&gt;One more correction while here: it is often said that key events stop during composition. The spec says the opposite. "During the composition session, keydown and keyup events MUST still be sent," and those events "MUST have the isComposing attribute set to true".&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is not only a CJK problem
&lt;/h2&gt;

&lt;p&gt;Here is the line that should widen your idea of who is affected. The spec describes &lt;code&gt;isComposing&lt;/code&gt; on the input event as true when the event is dispatched&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;during a dead key sequence or while an input method editor is active&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Dead keys.&lt;/strong&gt; A French, Czech, or Vietnamese layout, or a US-International layout, produces accented characters by a dead key followed by a letter. That is a composition session too. Anybody typing &lt;code&gt;é&lt;/code&gt;, &lt;code&gt;ñ&lt;/code&gt;, &lt;code&gt;ô&lt;/code&gt; or &lt;code&gt;ü&lt;/code&gt; can hit the same code path, on the same keyboard hardware you have.&lt;/p&gt;

&lt;p&gt;Which is the honest reason this survives so long in so many codebases. It is not exotic. It is simply invisible from a machine configured the way yours is, and the people who hit it describe it in the only words available to them: it does not work when I type my name.&lt;/p&gt;

&lt;p&gt;That sentence contains the entire bug and explains none of it, and no amount of re-reading the ticket will get you to a dead key.&lt;/p&gt;




&lt;p&gt;Specification quotes are from the W3C UI Events Working Draft of 21 February 2026, which asks to be cited as a work in progress.&lt;/p&gt;

</description>
      <category>i18n</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>ux</category>
    </item>
  </channel>
</rss>
