<?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: pandaMjm</title>
    <description>The latest articles on DEV Community by pandaMjm (@d_3d4196185a86b83009f8d).</description>
    <link>https://dev.to/d_3d4196185a86b83009f8d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4107159%2F39b077b2-7f64-4779-aae7-c56d8c393d7e.png</url>
      <title>DEV Community: pandaMjm</title>
      <link>https://dev.to/d_3d4196185a86b83009f8d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/d_3d4196185a86b83009f8d"/>
    <language>en</language>
    <item>
      <title>Capturing Browser Failures Without Persisting Form Values</title>
      <dc:creator>pandaMjm</dc:creator>
      <pubDate>Thu, 03 Sep 2026 04:41:49 +0000</pubDate>
      <link>https://dev.to/d_3d4196185a86b83009f8d/capturing-browser-failures-without-persisting-form-values-1cfp</link>
      <guid>https://dev.to/d_3d4196185a86b83009f8d/capturing-browser-failures-without-persisting-form-values-1cfp</guid>
      <description>&lt;p&gt;A screenshot captures the outcome of a browser failure.&lt;/p&gt;

&lt;p&gt;It usually does not capture the path that produced it.&lt;/p&gt;

&lt;p&gt;By the time a bug reaches another developer, the original browser session is gone. The recipient sees the screenshot, but not necessarily:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the action immediately before the failure&lt;/li&gt;
&lt;li&gt;the console error that appeared at the same time&lt;/li&gt;
&lt;li&gt;the request that returned HTTP 503&lt;/li&gt;
&lt;li&gt;the browser and page involved&lt;/li&gt;
&lt;li&gt;whether the captured evidence was complete&lt;/li&gt;
&lt;li&gt;whether an attachment changed after the report was created&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The obvious response is to record more data.&lt;/p&gt;

&lt;p&gt;That creates a second problem: browser sessions contain far more&lt;br&gt;
sensitive information than most bug reports need.&lt;/p&gt;
&lt;h2&gt;
  
  
  The evidence boundary matters more than the recorder
&lt;/h2&gt;

&lt;p&gt;A browser recorder can observe URLs, form inputs, request headers,&lt;br&gt;
console messages, cookies, DOM state, screenshots, and user actions.&lt;/p&gt;

&lt;p&gt;Persisting all of that may produce a detailed replay, but it also creates an artifact that is difficult to inspect, difficult to share, and risky to keep.&lt;/p&gt;

&lt;p&gt;For a local bug handoff, I found a smaller boundary more useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a value-free action trail&lt;/li&gt;
&lt;li&gt;relevant console errors&lt;/li&gt;
&lt;li&gt;failed requests and HTTP error responses&lt;/li&gt;
&lt;li&gt;browser identity&lt;/li&gt;
&lt;li&gt;limited page state&lt;/li&gt;
&lt;li&gt;a screenshot&lt;/li&gt;
&lt;li&gt;an explicit capture receipt&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not to recreate everything the user saw. It is to preserve the smallest useful action-to-failure chain.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;click button #7
  -&amp;gt; HTTP 503 GET /api/http-error
  -&amp;gt; console error: fixture:request-failed
input input #4 (length=14; value never persisted)
submit form
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The input action is useful. The value is not.&lt;/p&gt;

&lt;p&gt;Recording the character count confirms that an input occurred without&lt;br&gt;
turning the report into a storage location for an email address,&lt;br&gt;
password, token, or other form value.&lt;/p&gt;
&lt;h2&gt;
  
  
  Redact before persistence
&lt;/h2&gt;

&lt;p&gt;Redaction is strongest when sensitive data never reaches persistent&lt;br&gt;
storage.&lt;/p&gt;

&lt;p&gt;That means the capture path should sanitize data before appending it to an event log or report—not after the final report is assembled.&lt;/p&gt;

&lt;p&gt;Some practical boundaries include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;remove credentials embedded in URLs&lt;/li&gt;
&lt;li&gt;redact sensitive query parameters&lt;/li&gt;
&lt;li&gt;redact authorization-like strings&lt;/li&gt;
&lt;li&gt;never record typed form values&lt;/li&gt;
&lt;li&gt;bound dynamic strings by UTF-8 byte length&lt;/li&gt;
&lt;li&gt;visibly mark truncation instead of silently losing data&lt;/li&gt;
&lt;li&gt;expose dropped or corrupted evidence as degraded health&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last point is important.&lt;/p&gt;

&lt;p&gt;A recorder should not produce a clean-looking report after it failed to write part of the evidence. Missing evidence is itself evidence about the reliability of the capture.&lt;/p&gt;
&lt;h2&gt;
  
  
  Keep observations separate from conclusions
&lt;/h2&gt;

&lt;p&gt;Suppose a user clicks Save, a request returns HTTP 503, and an error&lt;br&gt;
message appears.&lt;/p&gt;

&lt;p&gt;The recorder can safely report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A click was followed by an HTTP 503 response and a visible error.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It cannot safely report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The HTTP 503 caused the visible error.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The events are temporally related, but temporal proximity is not proof of root cause.&lt;/p&gt;

&lt;p&gt;A durable bug report should make that distinction explicit. Developers and coding agents can investigate the code afterward, but the recorder should not turn correlation into a confident diagnosis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the artifact independently checkable
&lt;/h2&gt;

&lt;p&gt;A report directory is more useful when the recipient can check it&lt;br&gt;
without reopening the application or browser.&lt;/p&gt;

&lt;p&gt;A minimal verification layer can check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the report format and compatible version&lt;/li&gt;
&lt;li&gt;safe attachment paths&lt;/li&gt;
&lt;li&gt;declared attachment sizes&lt;/li&gt;
&lt;li&gt;SHA-256 attachment hashes&lt;/li&gt;
&lt;li&gt;capture receipt consistency&lt;/li&gt;
&lt;li&gt;whether the browser shutdown result contradicts the report&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This does not prove who created the report. It also does not prove that the reported root cause is correct.&lt;/p&gt;

&lt;p&gt;It does detect accidental or deliberate attachment changes and&lt;br&gt;
structural inconsistencies.&lt;/p&gt;

&lt;p&gt;Those authenticity limits should be part of the output rather than&lt;br&gt;
hidden in documentation.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why not use a HAR, Playwright trace, or Sentry?
&lt;/h2&gt;

&lt;p&gt;These tools solve adjacent problems.&lt;/p&gt;

&lt;p&gt;A HAR file is a good fit when the primary artifact is network traffic.&lt;/p&gt;

&lt;p&gt;Playwright is a good fit after a flow is understood well enough to&lt;br&gt;
automate as a repeatable test.&lt;/p&gt;

&lt;p&gt;Sentry and similar observability systems are designed to collect&lt;br&gt;
failures across deployed applications and real users.&lt;/p&gt;

&lt;p&gt;DevTools and browser MCP tools are strong choices for live&lt;br&gt;
investigation.&lt;/p&gt;

&lt;p&gt;The gap I wanted to address was narrower:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A human can reproduce the local browser bug, but it has not been&lt;br&gt;
automated yet, and the evidence needs to survive the browser session.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is a handoff problem rather than a testing or monitoring problem.&lt;/p&gt;
&lt;h2&gt;
  
  
  A small implementation of this approach
&lt;/h2&gt;

&lt;p&gt;I implemented these constraints in an MIT-licensed CLI called&lt;br&gt;
BugBaton.&lt;/p&gt;

&lt;p&gt;It launches an isolated Chrome profile on a loopback CDP endpoint,&lt;br&gt;
records one manual reproduction, and writes ordinary JSON, Markdown,&lt;br&gt;
and PNG files.&lt;/p&gt;

&lt;p&gt;It requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 22 or newer&lt;/li&gt;
&lt;li&gt;Chrome, Chromium, or Chrome Canary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It does not require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an account&lt;/li&gt;
&lt;li&gt;a cloud service&lt;/li&gt;
&lt;li&gt;a browser extension&lt;/li&gt;
&lt;li&gt;an MCP server&lt;/li&gt;
&lt;li&gt;runtime npm dependencies&lt;/li&gt;
&lt;li&gt;telemetry&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The packaged deterministic demo can be run without cloning a repository or providing an existing application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;--yes&lt;/span&gt; &lt;span class="nt"&gt;--package&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;bugbaton &lt;span class="nt"&gt;--&lt;/span&gt; bugbaton demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The demo only reports success after observing an action, a browser error, and a failed request. Otherwise, it returns an explicit incomplete evidence error.&lt;/p&gt;

&lt;p&gt;A saved report can be checked later with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bugbaton verify REPORT_DIR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The implementation, example report, tests, and design decisions are&lt;br&gt;
available here:&lt;br&gt;
&lt;a href="https://github.com/mun-jeong-min/BugBaton" rel="noopener noreferrer"&gt;https://github.com/mun-jeong-min/BugBaton&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main question I am still exploring is not how much browser data can be captured.&lt;/p&gt;

&lt;p&gt;It is how little data a useful browser failure handoff actually needs.&lt;/p&gt;

&lt;p&gt;What would you remove from this evidence boundary, and what would you&lt;br&gt;
still need before trusting the report?&lt;/p&gt;




&lt;p&gt;Disclosure: I am the author of BugBaton. I used an AI coding and writing assistant to help edit this article. I reviewed the technical claims, commands, and examples.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>node</category>
      <category>opensource</category>
      <category>debugging</category>
    </item>
  </channel>
</rss>
