<?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: Cn</title>
    <description>The latest articles on DEV Community by Cn (@cn308d66c92e2).</description>
    <link>https://dev.to/cn308d66c92e2</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%2F4022031%2Fad680799-44e0-4e05-8f29-af4001370f84.png</url>
      <title>DEV Community: Cn</title>
      <link>https://dev.to/cn308d66c92e2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cn308d66c92e2"/>
    <language>en</language>
    <item>
      <title>Poka-yoke for your online store: finding the bug that made a "bundle" contain almost nothing</title>
      <dc:creator>Cn</dc:creator>
      <pubDate>Thu, 09 Jul 2026 02:27:36 +0000</pubDate>
      <link>https://dev.to/cn308d66c92e2/poka-yoke-for-your-online-store-finding-the-bug-that-made-a-bundle-contain-almost-nothing-35fl</link>
      <guid>https://dev.to/cn308d66c92e2/poka-yoke-for-your-online-store-finding-the-bug-that-made-a-bundle-contain-almost-nothing-35fl</guid>
      <description>&lt;h2&gt;
  
  
  Poka-yoke, briefly
&lt;/h2&gt;

&lt;p&gt;Poka-yoke (ポカヨケ) is a term from Japanese manufacturing — mistake-proofing. It's not about detecting defects after the fact; it's about designing a check so an error can't slip through unnoticed in the first place. Toyota built an entire quality system around this idea: assume mistakes will happen, and put a mechanism in place that catches them automatically instead of relying on someone noticing.&lt;/p&gt;

&lt;p&gt;The same idea applies directly to content and e-commerce platforms — just applied to data instead of physical parts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Content platforms (think Substack, Gumroad, or any CMS where pricing and bundling are edited separately from the article body) let creators edit price, body text, and bundle membership independently. After enough edits — a price cut here, a bundle reshuffle there — it's easy to end up with a page that &lt;em&gt;looks&lt;/em&gt; fine but is quietly broken underneath.&lt;/p&gt;

&lt;p&gt;Two real patterns I ran into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A "bundle" product page rendered normally, but the actual bundle had lost almost all of its member items along the way.&lt;/li&gt;
&lt;li&gt;After an individual item's price was cut, the bundle's price wasn't updated — so buying the bundle ended up costing &lt;em&gt;more&lt;/em&gt; than buying the items separately, while the copy still said "bundle and save."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Neither of these throws an error. The rendering layer just displays whatever data exists, correct or not. There was no poka-yoke in place — nothing designed to catch the mistake automatically, so it just sat there silently costing money.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Pull the real data via the public API
&lt;/h3&gt;

&lt;p&gt;Most of these platforms expose a read API for published content. If you're logged in, you can usually just &lt;code&gt;fetch&lt;/code&gt; with &lt;code&gt;credentials: 'include'&lt;/code&gt; and reuse your browser session.&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="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`https://example.com/api/v3/notes/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;?draft=false`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;include&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Cross-check "price mentioned in body" against "actual price"
&lt;/h3&gt;

&lt;p&gt;A simple regex over the body HTML surfaces every price string. Compare that against the real price field (or the actual bundle price) and any mismatch is a stale number left over from a previous edit.&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="nx"&gt;prices&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matchAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;[\$&lt;/span&gt;&lt;span class="sr"&gt;¥&lt;/span&gt;&lt;span class="se"&gt;][\d&lt;/span&gt;&lt;span class="sr"&gt;,&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+/g&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="nx"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Count actual bundle members vs. the claimed count
&lt;/h3&gt;

&lt;p&gt;Open the bundle page and count how many items are actually attached. Compare it against what the marketing copy claims ("5-piece bundle," etc.). Mismatches here are silent revenue leaks — a customer paying for a "bundle" that's mostly empty is not a good look.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Fix it via automation, not manual re-entry
&lt;/h3&gt;

&lt;p&gt;Once a mismatch is found, browser automation (Playwright, etc.) can walk through the normal edit → publish flow the same way a human would, just faster and across every affected item at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;None of this required anything sophisticated — no ML, no scraping tricks, just diffing public data against itself. The interesting part is &lt;em&gt;why&lt;/em&gt; nobody notices: creators trust the screen they're looking at. If the rendering layer never throws an error, there's no signal that anything is wrong. The only way to catch it is to stop trusting the UI and go straight to the data.&lt;/p&gt;

&lt;p&gt;That's the poka-yoke mindset applied to a digital storefront: don't wait to notice the mistake, build the check that catches it automatically. This generalizes to any platform where content, pricing, and bundling are edited independently over time — the more edit history a page has, the more likely something has quietly drifted out of sync.&lt;/p&gt;

&lt;p&gt;If you run a small store or content business and want a free pass over your own setup, feel free to reach out — happy to take a look.&lt;/p&gt;

</description>
      <category>webdevecommerceautomation</category>
    </item>
  </channel>
</rss>
