<?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: MarcoBlch</title>
    <description>The latest articles on DEV Community by MarcoBlch (@marcoblch).</description>
    <link>https://dev.to/marcoblch</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%2F4112464%2F71d50e82-606f-4c4a-98bc-5443c44d14ac.jpg</url>
      <title>DEV Community: MarcoBlch</title>
      <link>https://dev.to/marcoblch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marcoblch"/>
    <language>en</language>
    <item>
      <title>My MCP Server Broke the Claude Directory Rules, So I Built a Second Endpoint</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Wed, 25 Nov 2026 14:14:48 +0000</pubDate>
      <link>https://dev.to/marcoblch/my-mcp-server-broke-the-claude-directory-rules-so-i-built-a-second-endpoint-5d46</link>
      <guid>https://dev.to/marcoblch/my-mcp-server-broke-the-claude-directory-rules-so-i-built-a-second-endpoint-5d46</guid>
      <description>&lt;p&gt;On November 25, &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt; was approved as a community connector in Claude's official connector directory. That sentence took about seven weeks, and most of them were spent on one tool that could not be in the listing.&lt;/p&gt;

&lt;p&gt;This is the story of that tool, the second endpoint I built around it, and the checklist I would run before submitting any MCP server to a directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I was trying to submit
&lt;/h2&gt;

&lt;p&gt;OutfitMaker is a wardrobe app. People photograph their clothes once, and it suggests outfits from the pieces they own, matched to the weather and the occasion. Its MCP server lets an assistant do the same from a chat, with OAuth (dynamic client registration and PKCE) so the assistant only ever reads the connected account's own wardrobe.&lt;/p&gt;

&lt;p&gt;The authenticated endpoint, &lt;code&gt;/mcp/wardrobe&lt;/code&gt;, has six tools. Five of them read things: today's outfit, a suggestion for an occasion, a summary of the wardrobe, a short help text. The sixth is &lt;code&gt;show_me_the_look&lt;/code&gt;. It takes one of the suggested outfits and renders it on a model, as an image. It is the most visual thing the product does, and in a chat it is the moment people actually react to.&lt;/p&gt;

&lt;p&gt;In early October I had the submission ready: icon, screenshots, privacy policy section for AI assistants, a demo account for reviewers, tool titles. The URL in the form was &lt;code&gt;/mcp/wardrobe&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule I had not read
&lt;/h2&gt;

&lt;p&gt;The form links to the &lt;a href="https://support.claude.com/en/articles/13145358-anthropic-software-directory-policy" rel="noopener noreferrer"&gt;Anthropic Software Directory Policy&lt;/a&gt;. When I got to that step on November 18, I read it properly for the first time.&lt;/p&gt;

&lt;p&gt;Section 4.B lists AI-generated media that the directory does not accept. Image generation models that are not purely design focused are on it, and "people-generation capabilities" is named in the same line. Slides, diagrams, charts, UI mockups and logos are allowed. A tool that draws a person wearing your clothes is not a diagram.&lt;/p&gt;

&lt;p&gt;The form also asks you to confirm that your tool descriptions contain no instructions to the model.&lt;/p&gt;

&lt;p&gt;So I had two problems. One tool generated people. And when I reread my descriptions, several sentences were not describing the tool at all. They were telling the model what to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  The options I had
&lt;/h2&gt;

&lt;p&gt;There were three ways out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tick the boxes and hope the review does not look closely.&lt;/li&gt;
&lt;li&gt;Remove &lt;code&gt;show_me_the_look&lt;/code&gt; from the server for everyone.&lt;/li&gt;
&lt;li&gt;Serve a version of the server that matches the policy, and keep the full one where it is allowed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first was never on the table. A listing that depends on a reviewer not noticing is a listing you can lose any day, and I did not want my name on a form that said something false.&lt;/p&gt;

&lt;p&gt;The second would have broken the people already connected through &lt;code&gt;/mcp/wardrobe&lt;/code&gt;, and the version prepared for ChatGPT. When I checked OpenAI's app rules the same day, they did not exclude this kind of image generation.&lt;/p&gt;

&lt;p&gt;So I went with the third.&lt;/p&gt;

&lt;h2&gt;
  
  
  /mcp/closet
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;POST /mcp/closet&lt;/code&gt; is the same server with a different set of tools. It went out in PR #287.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;WARDROBE_PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/mcp/wardrobe"&lt;/span&gt;
&lt;span class="no"&gt;CLOSET_PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/mcp/closet"&lt;/span&gt;
&lt;span class="no"&gt;MCP_PATHS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"/mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;WARDROBE_PATH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CLOSET_PATH&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;freeze&lt;/span&gt;
&lt;span class="no"&gt;TOKEN_REQUIRED_PATHS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;WARDROBE_PATH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CLOSET_PATH&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;freeze&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;scopes_for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="no"&gt;CLOSET_PATH&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;SCOPE_WARDROBE_READ&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;SCOPES&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The controller picks the variant from the request path and passes it down in the server context. The account tools come from one switch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# /mcp/closet: nothing that generates an image.&lt;/span&gt;
&lt;span class="no"&gt;CLOSET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;ClosetOutfitToday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;MyWardrobeSummary&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;freeze&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;closet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;closet&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="no"&gt;CLOSET&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;ALL&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What changes on the closet endpoint:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Five tools.&lt;/strong&gt; Three public ones (what to wear today, suggest an outfit, about) and two that read the account (today's outfit from your own wardrobe, wardrobe summary). No &lt;code&gt;show_me_the_look&lt;/code&gt;, and no widget that renders a look.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One scope.&lt;/strong&gt; The OAuth metadata and the 401 challenge only ask for &lt;code&gt;wardrobe:read&lt;/code&gt;. The render tool needed a write scope, and a connector that cannot render has no reason to ask for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No back door.&lt;/strong&gt; A call to &lt;code&gt;show_me_the_look&lt;/code&gt; on &lt;code&gt;/mcp/closet&lt;/code&gt; is not treated as an account tool. It goes on to the server, which answers "Tool not found" like it would for any other unknown name. I did not want a hidden tool that still worked if a client guessed its name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A link instead of a render.&lt;/strong&gt; &lt;code&gt;my_outfit_today&lt;/code&gt; on this endpoint ends with a link to the suggestion's page in the app. If you want to see the look on a model, you open OutfitMaker. The connector itself never generates an image.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A neutral help text.&lt;/strong&gt; &lt;code&gt;about_outfitmaker&lt;/code&gt; on this endpoint does not mention renders or plans.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;/mcp/wardrobe&lt;/code&gt; kept its six tools and its behaviour. The MCP tests passed (171 runs, 0 failures), including a new integration test file just for the closet variant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Descriptions that describe
&lt;/h2&gt;

&lt;p&gt;This part applied to every endpoint, not just the new one.&lt;/p&gt;

&lt;p&gt;The weather tool's description ended with a hint I had added earlier: "Asked in the evening? Use day=tomorrow". Useful, maybe. It was also an instruction to the model sitting inside a tool description, which is exactly what the form asks you to rule out. It went.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;my_outfit_today&lt;/code&gt; had a sentence telling the model never to present a borrowed basic (say, a pair of dark jeans when the closet has no bottoms) as the user's own piece. That rule matters, so I did not drop it. I moved it into the tool result, where it is a fact about that specific answer instead of an order in the description.&lt;/p&gt;

&lt;p&gt;The wardrobe summary said it was "useful context before suggesting or discussing outfits". That is advice to the model about when to call it. Now it says what it returns, that it is read-only, and that it is free.&lt;/p&gt;

&lt;p&gt;The rule I ended up with: a description says what the tool does, what it needs, and what it returns. Anything about how the assistant should behave either belongs in the result or does not belong anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  The annotation I thought I had
&lt;/h2&gt;

&lt;p&gt;The submission portal scans your server, and it flagged every tool with "Missing title annotation". My tools already had a &lt;code&gt;title&lt;/code&gt;. In MCP that is a top-level field on the tool, and &lt;code&gt;annotations.title&lt;/code&gt; is a separate one. The portal wanted the second.&lt;/p&gt;

&lt;p&gt;PR #288 added it to the nine tool definitions across both endpoints, same text as the existing title:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nf"&gt;annotations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"My wardrobe summary"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;read_only_hint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;destructive_hint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;open_world_hint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the form was submitted on November 20 the warning was still showing, even though &lt;code&gt;tools/list&lt;/code&gt; returned both titles on all five tools. It did not block the submission, so my guess is a cached scan on the portal side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timeline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Early October: submission package ready, pointing at &lt;code&gt;/mcp/wardrobe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;November 18: policy read, endpoint built, descriptions cleaned, annotations added.&lt;/li&gt;
&lt;li&gt;November 20: submitted with &lt;code&gt;/mcp/closet&lt;/code&gt;, five tools.&lt;/li&gt;
&lt;li&gt;November 25: approved as a community connector, then published from the directory admin page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The review took five days. The part that took weeks was me not reading the policy before building the package.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist I would use next time
&lt;/h2&gt;

&lt;p&gt;If you are about to submit an MCP server to a directory, this is what I would check first:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Read the policy before the form.&lt;/strong&gt; Go through the excluded use cases line by line against each tool, not against the product as a whole. My product was fine. One tool was not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Split by endpoint, not by flag.&lt;/strong&gt; A separate path with its own tool list, its own scopes and its own metadata is easy to reason about and easy to test. A tool that is hidden but still callable is not compliant, it is just quiet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask for the smallest scope the endpoint can use.&lt;/strong&gt; If a tool is gone, the scope it needed should be gone from the challenge too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strip descriptions down to what, needs and returns.&lt;/strong&gt; Search them for "use", "always", "never", "before", "call". Each hit is probably talking to the model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Move behavioural rules into results.&lt;/strong&gt; If something must be true about an answer, say it in the answer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set &lt;code&gt;annotations.title&lt;/code&gt; and the read-only or destructive hints on every tool&lt;/strong&gt;, even if you already have a top-level title.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Have the privacy policy URL ready and actually check it.&lt;/strong&gt; I learned that one the hard way on &lt;a href="https://meridianbuild.dev/blog/privacy-policy-url-nobody-was-watching/" rel="noopener noreferrer"&gt;a different project&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never tick a box that is not true yet.&lt;/strong&gt; Fix the product, then tick it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The full version of the server, render included, still runs at &lt;code&gt;/mcp/wardrobe&lt;/code&gt;. The version in the Claude directory reads your wardrobe and sends you to the app for the picture. That turned out to be a reasonable split, and if you are curious how the suggestions themselves are built, I wrote about &lt;a href="https://meridianbuild.dev/blog/multimodal-ai-for-outfit-suggestions/" rel="noopener noreferrer"&gt;the multimodal side&lt;/a&gt; a while ago.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/mcp-server-claude-directory-second-endpoint/" rel="noopener noreferrer"&gt;Meridian Build&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>rails</category>
      <category>indiehackers</category>
    </item>
    <item>
      <title>The Privacy Policy URL Nobody Was Watching</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Fri, 20 Nov 2026 17:26:36 +0000</pubDate>
      <link>https://dev.to/marcoblch/the-privacy-policy-url-nobody-was-watching-55gm</link>
      <guid>https://dev.to/marcoblch/the-privacy-policy-url-nobody-was-watching-55gm</guid>
      <description>&lt;p&gt;&lt;a href="https://meridianbuild.dev/projects/kidcapital/" rel="noopener noreferrer"&gt;KidCapital&lt;/a&gt; is a small money game for kids, on iOS and Android. Like every app on both stores, it has a privacy policy URL typed into two consoles: Google Play Console and App Store Connect. I filled those fields once, early, and moved on to the parts of the app people actually see.&lt;/p&gt;

&lt;p&gt;On November 20 I was cleaning up a list of warnings in Play Console before sending a release for review. The privacy policy URL was one of the blockers. I clicked it. 404.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the link died
&lt;/h2&gt;

&lt;p&gt;The URL pointed to a GitHub Pages site for the app's repository. A few weeks earlier I had restricted what that Pages site served, for good reasons, and later it stopped serving the policy at all. Nothing in my setup knew that a store console depended on that one path. The site changed, the link broke, and the only system that noticed was Google's review pipeline, weeks later.&lt;/p&gt;

&lt;p&gt;For a kids' app that is not a cosmetic problem. The privacy policy is the document a parent, or a store reviewer, reads to decide whether the app is safe. Mine was a dead page.&lt;/p&gt;

&lt;h2&gt;
  
  
  My first fix was wrong too
&lt;/h2&gt;

&lt;p&gt;The App Store listing had a different URL: a GitHub gist. It worked, it loaded, Apple had accepted it. The quick fix was obvious: paste the same gist URL into Play Console, both stores aligned, done. I did that.&lt;/p&gt;

&lt;p&gt;Then I read the gist.&lt;/p&gt;

&lt;p&gt;It dated from March, from an earlier version of the app. It mentioned collecting an email address and using PostHog for analytics. The current app does neither. It uses anonymous accounts with an animal pseudonym, and RevenueCat for the one in-app purchase. The real, current policy existed. It was in the repository as an HTML page, written in French and English in October, covering both Apple and Google. It just was not at any URL either store knew about.&lt;/p&gt;

&lt;p&gt;So for months the App Store had pointed parents at a policy describing data collection the app no longer did, and for some time Google Play had pointed them at nothing. And for a few hours on November 20, after my "fix", both stores pointed at the outdated one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the policy lives now
&lt;/h2&gt;

&lt;p&gt;I wanted a URL I control, on a domain that is not tied to how one repository happens to be published. This blog already runs as a static site with automatic deploys, so the policy now lives here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://meridianbuild.dev/kidcapital/privacy/" rel="noopener noreferrer"&gt;https://meridianbuild.dev/kidcapital/privacy/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is a plain copy of the HTML page from the app repository, dropped into the blog's &lt;code&gt;public/kidcapital/privacy/&lt;/code&gt; folder, so the static build serves it as is. No framework, no layout, nothing that a future blog redesign can break by accident.&lt;/p&gt;

&lt;p&gt;Then the consoles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google Play&lt;/strong&gt;: URL replaced, the change sits with other pending changes until it is sent for review and published.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App Store Connect&lt;/strong&gt;: URL replaced, it goes live with the next app version, which is already in the queue.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cost of this setup is that the policy now exists in two places, the app repository and the blog. Any future change has to be made in both. I wrote that down where I will see it, because "two copies" is exactly how the gist went stale.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is still not aligned
&lt;/h2&gt;

&lt;p&gt;Fixing the URL surfaced the next layer. Apple's privacy label for the app, the "Data collected" section on the App Store page, still declares the categories from March: contact info, diagnostics, usage data. Those match the old gist, not the app. Play's Data safety form and the current policy say something different. That is the next thing to realign, and it matters more than the URL, because the label is what most parents actually look at.&lt;/p&gt;

&lt;p&gt;I am mentioning it because it is the honest state of things. Fixing one field in a store console tends to reveal the three next to it that were filled in the same week, by the same tired person, for a version of the app that no longer exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lesson
&lt;/h2&gt;

&lt;p&gt;Every store console has a handful of URLs you type once: privacy policy, terms, support, marketing site. They are legal and trust documents, they are linked from your public listing, and nothing watches them. The console checks the URL when you save it. After that, nobody does. Your uptime monitor watches your homepage and your API. Your CI checks your code. The page that a regulator, a reviewer or a worried parent will open is checked by no one until something rejects your release.&lt;/p&gt;

&lt;p&gt;What I changed in how I work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Legal pages live on a domain I control&lt;/strong&gt;, served as static files, not on whatever hosting a repository happens to have this month.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One source, one URL per document&lt;/strong&gt;, and the same URL in every console. If the stores disagree, one of them is wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read the page, not the status code.&lt;/strong&gt; The gist returned 200 the whole time. A working link to the wrong document is worse than a dead one, because nothing ever flags it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you ship an app, open your store consoles today, click every URL you declared, and read what is on the other end. It does not take long. I had not done it since the day I filled those fields.&lt;/p&gt;

&lt;p&gt;If you are setting up release automation for a small app, I wrote about &lt;a href="https://meridianbuild.dev/blog/one-version-number-ci-play-drafts/" rel="noopener noreferrer"&gt;using one version number for iOS and Android in CI&lt;/a&gt;, which is where this list of console chores started.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/privacy-policy-url-nobody-was-watching/" rel="noopener noreferrer"&gt;Meridian Build&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mobile</category>
      <category>privacy</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Shrinking My Photos Did Not Cut My Gemini Bill</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Fri, 20 Nov 2026 17:25:45 +0000</pubDate>
      <link>https://dev.to/marcoblch/shrinking-my-photos-did-not-cut-my-gemini-bill-6d4</link>
      <guid>https://dev.to/marcoblch/shrinking-my-photos-did-not-cut-my-gemini-bill-6d4</guid>
      <description>&lt;p&gt;Every time someone adds a piece of clothing to their wardrobe in &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;, a background job sends the photo to Gemini on Vertex AI. The model returns a small JSON object: category, colour, a description, a few tags, translated labels, and which way the garment is rotated in the photo. That is the whole job. It runs on every upload, so it runs a lot.&lt;/p&gt;

&lt;p&gt;On November 20 I read the Google Cloud bill line by line. The top line was image input for that analysis call, about 15 euros over 30 days. Not a disaster, but it was the biggest one, and it grows with every new user who photographs their closet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The obvious fix, which does nothing
&lt;/h2&gt;

&lt;p&gt;Phones take large photos. My first idea was the one everybody has: resize the image to something modest before encoding it, send fewer bytes, pay less.&lt;/p&gt;

&lt;p&gt;Before writing that code I checked how Gemini counts image tokens. It does not bill by bytes or by pixels in the way I assumed. An image becomes a fixed number of tokens determined by the resolution setting of the request, and the model scales whatever you send to fit that budget. A huge photo and a small photo of the same shirt land on the same token count.&lt;/p&gt;

&lt;p&gt;So resizing on my side would have cost CPU on the worker, added a dependency on image processing in a code path that already had &lt;a href="https://meridianbuild.dev/blog/my-ai-was-blind-in-production/" rel="noopener noreferrer"&gt;its own share of trouble with missing binaries&lt;/a&gt;, and changed nothing on the invoice. Smaller uploads are still nice for storage and bandwidth. They are just not a Gemini cost lever.&lt;/p&gt;

&lt;h2&gt;
  
  
  The field that does change the count
&lt;/h2&gt;

&lt;p&gt;The lever is &lt;code&gt;mediaResolution&lt;/code&gt; in &lt;code&gt;generationConfig&lt;/code&gt;. It tells the model how much detail to keep from each image, and the token count follows. The values are &lt;code&gt;MEDIA_RESOLUTION_LOW&lt;/code&gt;, &lt;code&gt;MEDIA_RESOLUTION_MEDIUM&lt;/code&gt; and &lt;code&gt;MEDIA_RESOLUTION_HIGH&lt;/code&gt;, and if you do not set it, you get the default.&lt;/p&gt;

&lt;p&gt;Lowering detail on an image classifier sounds risky, so I did not pick a value from the docs. I ran the real call in production on 12 garment photos at each setting: default, MEDIUM, LOW. For each photo I compared category, colour and rotation, and read &lt;code&gt;promptTokenCount&lt;/code&gt; from the response metadata.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Prompt tokens&lt;/th&gt;
&lt;th&gt;Result vs default&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Default&lt;/td&gt;
&lt;td&gt;1447&lt;/td&gt;
&lt;td&gt;reference&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MEDIUM&lt;/td&gt;
&lt;td&gt;874&lt;/td&gt;
&lt;td&gt;same category, colour and rotation on all 12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LOW&lt;/td&gt;
&lt;td&gt;611&lt;/td&gt;
&lt;td&gt;one colour wrong&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The prompt token count includes the text of my prompt, which does not change between runs. So the drop on the image part alone is larger than the 40% you see in the table.&lt;/p&gt;

&lt;p&gt;LOW was tempting. It is cheaper again, and on 11 of the 12 photos it was right. But colour is the field users notice first. If the app calls a navy sweater black, every outfit built on it inherits the mistake, and the user's trust in the whole wardrobe drops with it. One error in twelve is too many for the field people check with their own eyes. MEDIUM gave identical answers, so MEDIUM it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The change
&lt;/h2&gt;

&lt;p&gt;It is three lines in the service plus a constant, shipped as PR #291 (commit 356dbbc in a private repo):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;MEDIA_RESOLUTION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"MEDIA_RESOLUTION_MEDIUM"&lt;/span&gt;

&lt;span class="n"&gt;generationConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;maxOutputTokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2048&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;responseMimeType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;mediaResolution&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;MEDIA_RESOLUTION&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I left the test results in a comment above the field, with the numbers. The next person tempted to switch to LOW to save a bit more, which will probably be me, should see why I did not.&lt;/p&gt;

&lt;p&gt;And one line in an existing test that builds the request body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;assert_equal&lt;/span&gt; &lt;span class="s2"&gt;"MEDIA_RESOLUTION_MEDIUM"&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="nf"&gt;dig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"generationConfig"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mediaResolution"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That assertion looks trivial. It is there because this kind of setting disappears silently. Someone refactors the request builder, the field is dropped, every test still passes because the model answers fine at default resolution, and the bill goes back up without a single error. A test that pins a cost setting is the only alarm you get for that kind of regression.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it is worth
&lt;/h2&gt;

&lt;p&gt;My estimate is a saving of around 6 euros a month at the current volume. That is small in absolute terms. It is also free, permanent, and it scales with uploads, which is the one usage pattern I hope keeps growing.&lt;/p&gt;

&lt;p&gt;The more useful outcome for me is the habit. Before optimising an AI call, I now check how the provider actually counts the units I pay for. My intuition said bytes. The answer was a setting I had never read, sitting one level below &lt;code&gt;maxOutputTokens&lt;/code&gt; in the same config hash.&lt;/p&gt;

&lt;p&gt;If you send images to Gemini, look at your &lt;code&gt;generationConfig&lt;/code&gt;. If &lt;code&gt;mediaResolution&lt;/code&gt; is not there, you are paying for the default on every call. Run your own handful of real inputs at MEDIUM and LOW, compare the fields your users actually look at, and pick the lowest setting that gives the same answers.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/shrinking-photos-did-not-cut-my-gemini-bill/" rel="noopener noreferrer"&gt;Meridian Build&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gemini</category>
      <category>rails</category>
      <category>performance</category>
    </item>
    <item>
      <title>My Mailgun Subdomain Didn't Exist for iCloud</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Fri, 20 Nov 2026 17:24:54 +0000</pubDate>
      <link>https://dev.to/marcoblch/my-mailgun-subdomain-didnt-exist-for-icloud-1jce</link>
      <guid>https://dev.to/marcoblch/my-mailgun-subdomain-didnt-exist-for-icloud-1jce</guid>
      <description>&lt;p&gt;I send a lot of mail for &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt; through Mailgun: account emails, reminders, and my own replies to partners, which leave Gmail as &lt;a href="mailto:hello@outfitmaker.ai"&gt;hello@outfitmaker.ai&lt;/a&gt; through Mailgun's SMTP. Everything goes out on a sending subdomain, &lt;code&gt;mg.outfitmaker.ai&lt;/code&gt;. SPF and DKIM were green in the Mailgun dashboard. The setup had been "done" for months.&lt;/p&gt;

&lt;p&gt;On November 20 I finally opened the list of failed events instead of looking at the delivered count. 221 of the last 300 failures had the same message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sender address rejected: Domain not found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The receiving server was telling me that my sending domain did not exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the receiving server actually checks
&lt;/h2&gt;

&lt;p&gt;When Mailgun sends a message, the visible From can be anything you verified. The envelope sender, the address bounces go back to, is a Mailgun address on your sending domain. Something like &lt;code&gt;bounce+...@mg.outfitmaker.ai&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A lot of mail servers check that envelope sender before they accept anything. Postfix calls it &lt;code&gt;reject_unknown_sender_domain&lt;/code&gt;. The logic is simple: if a bounce had to come back to this address, could it? To answer, the server looks up the domain. If there is an MX record, fine. If there is no MX but there is an A record, also fine, because the mail RFCs treat the A record as an implicit MX. If there is neither, the domain is "not found" for mail purposes and the message is refused.&lt;/p&gt;

&lt;p&gt;So I checked &lt;code&gt;mg.outfitmaker.ai&lt;/code&gt;. TXT records for SPF and DKIM: present. MX: none. A: none. For a server running that check, my sending domain was a few TXT records floating in space.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why nobody noticed
&lt;/h2&gt;

&lt;p&gt;The failures were not spread evenly. They hit mostly &lt;code&gt;icloud.com&lt;/code&gt; and &lt;code&gt;privaterelay.appleid.com&lt;/code&gt;, the addresses Apple generates when someone signs up with "Hide My Email". Around 110 a day.&lt;/p&gt;

&lt;p&gt;Most of my test mail goes to Gmail, and my own inbox received everything. The dashboard said "delivered" for the bulk of traffic. The Apple users simply never got their emails, and people who never receive an email do not write to you about it.&lt;/p&gt;

&lt;p&gt;If your audience signs up with Apple, you are probably sending more mail to Private Relay addresses than you think. It is worth looking at failures grouped by recipient domain at least once.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix I wanted, and the one my registrar allowed
&lt;/h2&gt;

&lt;p&gt;The textbook fix is two MX records on the &lt;code&gt;mg&lt;/code&gt; host, pointing to Mailgun's inbound servers (&lt;code&gt;mxa.mailgun.org&lt;/code&gt; and &lt;code&gt;mxb.mailgun.org&lt;/code&gt;). Mailgun lists them in the domain setup as records for receiving. I never added them, because I did not need to receive mail on &lt;code&gt;mg&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The DNS for outfitmaker.ai lives at Namecheap. The root domain uses Namecheap's own email forwarding, which is how hello@ reaches my Gmail. When "Email Forwarding" is selected in Namecheap's mail settings, the panel manages the MX records itself and does not let you add custom ones. Switching to "Custom MX" changes the mode for the whole domain, and the forwarding on the root would stop.&lt;/p&gt;

&lt;p&gt;I did not want to touch the inbound path of the main domain to fix an outbound problem on a subdomain. So I used the fallback the receiving servers already accept: A records.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mg  A  34.36.182.139
mg  A  34.149.254.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those were the addresses of &lt;code&gt;mxa.mailgun.org&lt;/code&gt; and &lt;code&gt;mxb.mailgun.org&lt;/code&gt; when I looked them up. With an A record, &lt;code&gt;mg.outfitmaker.ai&lt;/code&gt; resolves, the "domain exists" check passes, and if a server ever tries to deliver a bounce to the implicit MX, it reaches Mailgun. Mail settings on the root stayed exactly as they were.&lt;/p&gt;

&lt;p&gt;The records went in on November 20 in the afternoon and were visible on Google's and Cloudflare's resolvers shortly after.&lt;/p&gt;

&lt;h2&gt;
  
  
  The catch with pinning IPs
&lt;/h2&gt;

&lt;p&gt;Hardcoding someone else's IP addresses in your DNS is a small debt. While writing this, I resolved the two Mailgun hosts again from a public resolver and both returned &lt;code&gt;34.36.182.139&lt;/code&gt;. My records still point to addresses Mailgun used, so the existence check keeps passing, which is all I need from them. But if Mailgun moves its inbound servers one day, my A records will quietly point at something else.&lt;/p&gt;

&lt;p&gt;For the existence check that does not matter much. For real bounce handling it might. The cleaner long term setup is a real MX on &lt;code&gt;mg&lt;/code&gt;, which means either moving the root forwarding away from the registrar panel or moving DNS to a provider that lets the two coexist. That is on the list, not done.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I check now
&lt;/h2&gt;

&lt;p&gt;I have not yet seen a full day of events since the fix. The plan for tomorrow is boring: filter failed events for "Domain not found" and see the count go to zero, then look at what is left in the failures, because the noise of 221 identical errors was hiding whatever else is in there.&lt;/p&gt;

&lt;p&gt;The general lesson, for me: a sending domain is a real domain. "SPF and DKIM verified" in the dashboard says nothing about whether the domain resolves for the server on the other side. Run the same lookups the receiver runs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig +short MX mg.yourdomain.com
dig +short A mg.yourdomain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If both come back empty, some of your mail is being refused right now, and probably by the inboxes you test least.&lt;/p&gt;

&lt;p&gt;If you run your own mail stack for a small product, I wrote earlier about &lt;a href="https://meridianbuild.dev/blog/blocking-7500-disposable-email-domains/" rel="noopener noreferrer"&gt;blocking disposable email domains at signup&lt;/a&gt;, which is the other end of the same pipe.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/mailgun-sending-subdomain-domain-not-found/" rel="noopener noreferrer"&gt;Meridian Build&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>email</category>
      <category>dns</category>
      <category>devops</category>
      <category>debugging</category>
    </item>
    <item>
      <title>My QA Bot Left a $1.99 Unpaid Checkout Every 30 Minutes</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Sun, 15 Nov 2026 22:00:40 +0000</pubDate>
      <link>https://dev.to/marcoblch/my-qa-bot-left-a-199-unpaid-checkout-every-30-minutes-5cn1</link>
      <guid>https://dev.to/marcoblch/my-qa-bot-left-a-199-unpaid-checkout-every-30-minutes-5cn1</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/qa-bot-unpaid-checkout-every-30-minutes/" rel="noopener noreferrer"&gt;meridianbuild.dev&lt;/a&gt;, my engineering blog documenting the real bugs and decisions behind &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One morning I opened the Stripe app on my phone and scrolled through the payments of &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;. This is what I saw for the night:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;02:00&lt;/td&gt;
&lt;td&gt;$1.99&lt;/td&gt;
&lt;td&gt;Incomplete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;02:30&lt;/td&gt;
&lt;td&gt;$1.99&lt;/td&gt;
&lt;td&gt;Incomplete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;03:00&lt;/td&gt;
&lt;td&gt;$1.99&lt;/td&gt;
&lt;td&gt;Incomplete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;03:30&lt;/td&gt;
&lt;td&gt;$1.99&lt;/td&gt;
&lt;td&gt;Incomplete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;03:50&lt;/td&gt;
&lt;td&gt;€7.99&lt;/td&gt;
&lt;td&gt;Failed (subscription update)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;04:00&lt;/td&gt;
&lt;td&gt;$1.99&lt;/td&gt;
&lt;td&gt;Incomplete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;04:30&lt;/td&gt;
&lt;td&gt;$1.99&lt;/td&gt;
&lt;td&gt;Incomplete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A $1.99 payment every 30 minutes, on the dot, all night. Nobody shops on a clock like that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it came from
&lt;/h2&gt;

&lt;p&gt;A few weeks earlier, my hosting provider reported a security incident. I rotated every secret, and to catch any breakage quickly, I added a temporary cron job: run the full end to end QA suite against production every 30 minutes instead of once a day.&lt;/p&gt;

&lt;p&gt;That suite tests the real purchase flow. One step opens a checkout for the $1.99 weekly pass and stops right before paying. That creates a real payment in Stripe, in the "incomplete" state. Nobody is charged.&lt;/p&gt;

&lt;p&gt;The suite had a cleanup step that cancels those test payments at the end of each run. It used an access token. That token was one of the secrets I rotated. The cleanup started failing silently, and the temporary cron was never removed.&lt;/p&gt;

&lt;p&gt;Result: 48 orphan payments a day, every day, for as long as nobody looked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it matters even if nobody was charged
&lt;/h2&gt;

&lt;p&gt;On their own, incomplete payments are harmless. But look at the table again. At 03:50 there is a real failure: the first charge after a free trial, declined by the bank.&lt;/p&gt;

&lt;p&gt;That is the line I actually care about. And it was sitting between test rows, looking just like them. A real signal, buried in noise I created myself.&lt;/p&gt;

&lt;p&gt;There is also the dashboard itself. "Incomplete" is how Stripe shows a customer who opened checkout and walked away. When half the rows are a bot, your abandoned checkout numbers are fiction.&lt;/p&gt;

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

&lt;p&gt;The immediate fix took one minute: back up the crontab, remove the 30 minute line, keep the daily run.&lt;/p&gt;

&lt;p&gt;The daily run still leaves one incomplete payment per day until the cleanup is reconnected with a valid token. That is a known, small, documented cost, which is very different from an unknown one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed in how I work
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Temporary jobs get an expiry date when they are created.&lt;/strong&gt; Not "remove after the incident", which nobody remembers, but a date written next to the line, and a reminder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A cleanup that fails must be loud.&lt;/strong&gt; The QA suite reported success because the tests passed. The cleanup failure went to a log nobody read. Now a cleanup failure is a QA failure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test traffic in production should be easy to filter out.&lt;/strong&gt; Every payment the bot creates should carry a tag in its metadata, so a single filter hides it in reports. Real customers should never share a list with a robot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read the raw list once in a while.&lt;/strong&gt; Dashboards summarize. The pattern here was obvious the moment I scrolled through the actual rows: same amount, same status, perfect 30 minute spacing.&lt;/p&gt;

&lt;p&gt;The bot did its job. It was me who forgot to tell it when to stop.&lt;/p&gt;

</description>
      <category>stripe</category>
      <category>testing</category>
      <category>devops</category>
      <category>saas</category>
    </item>
    <item>
      <title>I Sent 32 AI Agents to Find a Hackathon Idea. None Survived.</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Sun, 15 Nov 2026 22:00:33 +0000</pubDate>
      <link>https://dev.to/marcoblch/i-sent-32-ai-agents-to-find-a-hackathon-idea-none-survived-1cj5</link>
      <guid>https://dev.to/marcoblch/i-sent-32-ai-agents-to-find-a-hackathon-idea-none-survived-1cj5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/32-ai-agents-hackathon-idea-none-survived/" rel="noopener noreferrer"&gt;meridianbuild.dev&lt;/a&gt;, my engineering blog documenting the real bugs and decisions behind &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Marc Lou is running a $100K hackathon. It starts on November 16 and lasts 30 days. The ranking is not about votes or demos: it is about profit, verified from the payment provider. Nothing can be created before day one, not even a domain.&lt;/p&gt;

&lt;p&gt;That rule changes everything. You cannot lean on an existing audience for a product, an SEO head start or a waitlist. You need an idea that makes money from strangers, fast.&lt;/p&gt;

&lt;p&gt;So I did what a lot of builders are doing right now. I asked AI to find it for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;I run several Claude Code sessions on a small server, one per project, plus one that coordinates the others. For this I wrote a spec first, then let the coordinator launch a workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hunt.&lt;/strong&gt; Ten scout agents, each with a different angle: marketplaces, seasonal demand, end of year B2B, tools for builders, local shops, creators and resellers, 2027 deadlines, explicit "I would pay for" requests, spreadsheets and templates, and one wildcard. Each scout could spawn its own sub-agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merge.&lt;/strong&gt; Deduplicate and keep the ten strongest ideas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contradict.&lt;/strong&gt; Two independent critics per idea, each told to attack it from a different lens. When in doubt, refute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verdict.&lt;/strong&gt; Score what is left against the spec.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The spec had ten criteria. The ones that mattered most in the end:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;proof that people already pay for this (prices, reviews, real listings);&lt;/li&gt;
&lt;li&gt;a channel that reaches buyers within 48 hours;&lt;/li&gt;
&lt;li&gt;no free tool that already does the job well enough;&lt;/li&gt;
&lt;li&gt;a credible path to $5,000 of profit in 30 days without an audience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Around 32 agents in total. A few hours later, I had a verdict.&lt;/p&gt;

&lt;h2&gt;
  
  
  What came back
&lt;/h2&gt;

&lt;p&gt;One idea survived, barely: a plug and play Advent calendar for Wix, Webflow, Framer and Squarespace sites. It scored 13 out of 20 after the critics were done with it.&lt;/p&gt;

&lt;p&gt;The critics were good. They found that WordPress already has a free plugin for this, so the target had to move to the other site builders. They pointed out that most brands plan their December campaigns in October. And on the $5,000 criterion, almost every critic gave almost every idea a zero, including the survivor.&lt;/p&gt;

&lt;p&gt;Nine ideas died for the same three reasons: a free tool already covers it, there is no way to reach buyers in two days, and the math to $5,000 does not work from a cold start.&lt;/p&gt;

&lt;p&gt;One of the dead ideas was my favorite: a kit to run several Claude sessions from your phone, like I do. A scout found that Claude Code now ships official remote and messaging features, and open source projects already cover the rest. Dead in one paragraph.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round two, and the mistake
&lt;/h2&gt;

&lt;p&gt;I did not like the survivor. Neither did the person I build with. So we changed the target: French freelancers, a market I can actually talk to.&lt;/p&gt;

&lt;p&gt;One research agent came back with a plan: a tool that sends quotes as web pages, collects the deposit at signature and chases late payments. Its report said no French tool covered the whole flow.&lt;/p&gt;

&lt;p&gt;I turned that into a detailed plan, with pricing, a 30 day calendar and profit scenarios. Then came a simple question: "Are you sure there is no French competitor? What is the moat?"&lt;/p&gt;

&lt;p&gt;Three searches. Abby, a popular French invoicing tool, already offers signed online quotes, an automatic deposit invoice at signature and card payments. Freebe and others cover the rest. On freelance marketplaces, people sell "I will automate your quote follow ups" as a service.&lt;/p&gt;

&lt;p&gt;The agent was wrong, and I had not checked. That one is on me, not on the agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I actually learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The filter decides the outcome.&lt;/strong&gt; I told the critics to refute when in doubt. I asked for proof of demand, no free competitor and $5,000 without an audience. Almost nothing passes that, for anyone. Ten dead ideas out of ten is not a finding about the market. It is a finding about my spec.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"No competitor" is the cheapest claim to verify, and the most expensive to get wrong.&lt;/strong&gt; Any time an agent says a market is empty, it costs five minutes to search for it yourself. I now treat that sentence as a red flag, not a green light.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At launch, nobody has a moat.&lt;/strong&gt; Look at the products that win this kind of contest. They are rarely technically unique. Marc Lou's own ShipFast is a boilerplate in a category full of them. The moat comes later: an audience, a brand, customers who stay, data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Competition is not bad news.&lt;/strong&gt; Every competitor I found is proof that people pay for the problem. The useful question is not "is anyone doing this?" but "can I reach these buyers better than they can?"&lt;/p&gt;

&lt;h2&gt;
  
  
  So what now
&lt;/h2&gt;

&lt;p&gt;The hackathon starts tomorrow. Thirty two agents gave me a lot of research and one clear lesson: the hard part was never the idea. It is distribution, and no agent can find that for you. You build it, one conversation at a time.&lt;/p&gt;

&lt;p&gt;I am still using AI for research. I just stopped asking it to find a moat that does not exist on day one.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>indiehackers</category>
      <category>startup</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Five TikTok Formats, One Ceiling: What 2.5 Seconds Told Me</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Mon, 09 Nov 2026 18:22:31 +0000</pubDate>
      <link>https://dev.to/marcoblch/five-tiktok-formats-one-ceiling-what-25-seconds-told-me-2532</link>
      <guid>https://dev.to/marcoblch/five-tiktok-formats-one-ceiling-what-25-seconds-told-me-2532</guid>
      <description>&lt;p&gt;For two weeks in late October and early November, &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt; posted short videos on TikTok and Instagram almost every evening. The goal was simple: find a format that holds attention long enough for the algorithm to push it past its first test batch.&lt;/p&gt;

&lt;p&gt;I changed one thing at a time and wrote every number down. This is what the data said.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;OutfitMaker turns photos of the clothes you already own into outfits. The TikTok account targets the UK, where most viewers already were. Every video followed the same rule: the exact search phrase people type (from TikTok's "content gap" insights) on screen in the first second and in the caption.&lt;/p&gt;

&lt;p&gt;The benchmark was the best video before the test: a 7 second "which outfit?" duel that held viewers for 3.6 seconds on average, with 6.1% watching to the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five formats, side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Format&lt;/th&gt;
&lt;th&gt;Length&lt;/th&gt;
&lt;th&gt;Views&lt;/th&gt;
&lt;th&gt;Avg. watch time&lt;/th&gt;
&lt;th&gt;Watched to the end&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. AI duel, two looks side by side (benchmark)&lt;/td&gt;
&lt;td&gt;7 s&lt;/td&gt;
&lt;td&gt;about 770&lt;/td&gt;
&lt;td&gt;3.6 s&lt;/td&gt;
&lt;td&gt;6.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Same duel, longer, with a "comment 1 or 2" hook&lt;/td&gt;
&lt;td&gt;10 s&lt;/td&gt;
&lt;td&gt;744&lt;/td&gt;
&lt;td&gt;2.5 s&lt;/td&gt;
&lt;td&gt;1.96%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Same idea in a bright "game show" style&lt;/td&gt;
&lt;td&gt;8.5 s&lt;/td&gt;
&lt;td&gt;768&lt;/td&gt;
&lt;td&gt;2.4 s&lt;/td&gt;
&lt;td&gt;2.28%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Real screen recording of the app, "POV" hook&lt;/td&gt;
&lt;td&gt;9.8 s&lt;/td&gt;
&lt;td&gt;734&lt;/td&gt;
&lt;td&gt;2.4 s&lt;/td&gt;
&lt;td&gt;0.69%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. Finished look full screen at 0:00, with a voice&lt;/td&gt;
&lt;td&gt;10.2 s&lt;/td&gt;
&lt;td&gt;277 (day 1)&lt;/td&gt;
&lt;td&gt;2.5 s&lt;/td&gt;
&lt;td&gt;1.43%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three things stand out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The audience was never the problem.&lt;/strong&gt; Across the tests, women made up 66 to 81% of viewers and 69 to 87% were in the UK. On the videos where TikTok showed the full age split, 83 to 93% of viewers were 35 or older. That is exactly who I wanted to reach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The ceiling did not move.&lt;/strong&gt; The first four formats landed between 734 and about 770 views, roughly the size of TikTok's first test batch for a small account, and the fifth was at 277 after one day. None earned a second push.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Viewers left at the same moment.&lt;/strong&gt; Whatever I changed (length, colours, a real app recording, a voice, the result shown first), most people swiped away at about two seconds. Engagement stayed near zero: one like on the last video, no comments, no shares. The "comment 1 or 2 and we will style the winner tomorrow" mechanic got zero comments on 744 views, so I dropped it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What social did not bring
&lt;/h2&gt;

&lt;p&gt;From 20 October to 9 November, organic TikTok sent one visit to the site and Instagram none, against 8,880 from Google. Every paying customer and trial I could trace since September came from Google search.&lt;/p&gt;

&lt;p&gt;A small paid TikTok test brought 93 visits for 21 € and no sign-ups at all. Part of that was a bug: TikTok's in-app browser blocks Google sign-in, and that button was first on the page. I &lt;a href="https://meridianbuild.dev/blog/93-paid-clicks-zero-signups-google-button-tiktok" rel="noopener noreferrer"&gt;wrote about that one separately&lt;/a&gt;. Fixing it did not change the bigger picture.&lt;/p&gt;

&lt;p&gt;Search was quietly doing the work: 10,031 clicks from Google in 28 days, up 27% on the previous period.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lesson
&lt;/h2&gt;

&lt;p&gt;Short video is a slot machine with a two-second handle. The formats were reasonable, the targeting was right, and the data was consistent: watching an AI dress someone else does not stop the thumb.&lt;/p&gt;

&lt;p&gt;So I stopped producing. The account keeps a light presence (one or two posts a week, no heavy production), and the time goes where customers actually come from: pages that answer what people search for, and what happens after they land.&lt;/p&gt;

&lt;p&gt;The one variable I never tested is a real person talking to camera. If I try anything else on TikTok, it will be that, and it costs a phone and ten seconds.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/five-tiktok-formats-one-ceiling/" rel="noopener noreferrer"&gt;Meridian Build&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tiktok</category>
      <category>growth</category>
      <category>indiehackers</category>
      <category>seo</category>
    </item>
    <item>
      <title>My Invite Gate Held. The Database Had a Side Door.</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Wed, 04 Nov 2026 18:54:26 +0000</pubDate>
      <link>https://dev.to/marcoblch/my-invite-gate-held-the-database-had-a-side-door-448b</link>
      <guid>https://dev.to/marcoblch/my-invite-gate-held-the-database-had-a-side-door-448b</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/my-invite-gate-held-the-database-had-a-side-door/" rel="noopener noreferrer"&gt;meridianbuild.dev&lt;/a&gt;, my build log for &lt;a href="https://fastpass.email" rel="noopener noreferrer"&gt;FastPass&lt;/a&gt;, a paid inbox where people pay to reach you and get refunded if you don't reply.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A few weeks ago I wrote about how &lt;a href="https://meridianbuild.dev/blog/my-invite-only-gate-lived-in-the-browser/" rel="noopener noreferrer"&gt;my invite-only gate lived in the browser&lt;/a&gt; on &lt;a href="https://fastpass.email" rel="noopener noreferrer"&gt;FastPass&lt;/a&gt;, and how I moved it to the server. The comments were kind and sharp. One of them basically asked: you locked the front door, but did you check the back door?&lt;/p&gt;

&lt;p&gt;I hadn't, not properly. The gate lived in Edge Functions, and it was tested there. But Supabase also exposes the database itself to the browser through PostgREST, and what the browser can do there is decided by Row Level Security (RLS). If RLS let a client write a value that the gate trusts, the gate is decoration.&lt;/p&gt;

&lt;p&gt;On October 27 I checked. It did. This post is about how I found out without touching production data, and what I'd do the same way on any Supabase project.&lt;/p&gt;

&lt;p&gt;I'll describe the problems at the level of their class. They're fixed, but there's no reason to publish a recipe.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap: RLS is about rows, not columns
&lt;/h2&gt;

&lt;p&gt;This is the part I wish someone had told me on day one.&lt;/p&gt;

&lt;p&gt;An RLS policy like "a user can update their own profile" answers one question: which rows? It says nothing about which columns. Once a user is allowed to update their row, they can update every column in it, from the browser, with the public anon key and their own session.&lt;/p&gt;

&lt;p&gt;And Supabase's default privileges grant &lt;code&gt;anon&lt;/code&gt; and &lt;code&gt;authenticated&lt;/code&gt; broad rights on tables in &lt;code&gt;public&lt;/code&gt;. So unless you restrict it, "update your own row" means "update anything in your own row", including the fields your server logic trusts: a status, a flag, a role, a counter.&lt;/p&gt;

&lt;p&gt;That was my side door. The invite gate checked something that the database let the user change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: a copy of production, without production
&lt;/h2&gt;

&lt;p&gt;I wanted to attack the real schema, not the one in my migrations folder, because those two drift. But I didn't want to point probes at production, and I didn't have (or want) the database password on the VPS.&lt;/p&gt;

&lt;p&gt;So I rebuilt the schema from read-only catalog queries through the Supabase Management API: tables, columns, functions, triggers, every policy and every grant. No rows, no user data. Then I loaded it into a throwaway Postgres in Docker, on a tmpfs, with small stubs for &lt;code&gt;auth.uid()&lt;/code&gt; and &lt;code&gt;auth.jwt()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;How do you know the copy is faithful? I took an md5 fingerprint of the policies (a hash over &lt;code&gt;pg_policies&lt;/code&gt;, ordered) on both sides. Same hash, same rules. That one number is what made me trust everything that came after.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: probes that impersonate a client
&lt;/h2&gt;

&lt;p&gt;Each probe pretends to be one kind of caller and tries one thing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;savepoint&lt;/span&gt; &lt;span class="n"&gt;probe&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="k"&gt;local&lt;/span&gt; &lt;span class="k"&gt;role&lt;/span&gt; &lt;span class="n"&gt;authenticated&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="n"&gt;set_config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'request.jwt.claims'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'{"sub":"&amp;lt;user-a-uuid&amp;gt;","role":"authenticated"}'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;update&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;some_table&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="n"&gt;some_column&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'x'&lt;/span&gt; &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;row-of-user-b&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;rollback&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="n"&gt;savepoint&lt;/span&gt; &lt;span class="n"&gt;probe&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;set local role&lt;/code&gt; plus fake JWT claims is exactly what PostgREST does for a real request, so the policies see the same thing they'd see in production. Each probe runs inside a savepoint that is always rolled back, so probes can't affect each other.&lt;/p&gt;

&lt;p&gt;I wrote 70 of them, for three callers: anonymous, a logged-in user, and &lt;code&gt;service_role&lt;/code&gt;. They covered both directions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Must fail&lt;/strong&gt;: reading someone else's data, writing a protected column, calling a function you shouldn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Must work&lt;/strong&gt;: everything the real app does. A security fix that breaks signup is not a fix.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first run listed problems in four classes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Users could change sensitive columns on their own profile, because nothing restricted columns.&lt;/li&gt;
&lt;li&gt;Some policies meant for the server only were also open to client roles.&lt;/li&gt;
&lt;li&gt;Referral codes could be issued to accounts that shouldn't get them.&lt;/li&gt;
&lt;li&gt;Statistics views ran with their owner's rights instead of the caller's, because they were created without &lt;code&gt;security_invoker&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 3: the fix, with a proven way back
&lt;/h2&gt;

&lt;p&gt;The migration does what you'd expect: column-level &lt;code&gt;GRANT UPDATE (col1, col2)&lt;/code&gt; instead of table-wide rights, server-only policies restricted to &lt;code&gt;service_role&lt;/code&gt;, views switched to &lt;code&gt;security_invoker = true&lt;/code&gt;, and functions that look up trusted state in the database instead of in what the client sends.&lt;/p&gt;

&lt;p&gt;Before pushing it, I wrote the rollback and tested it on the bench: apply up, apply down, and check that the policy fingerprint is back to the production one. Only then did it go to production, the same day. After the migration, all 70 probes passed, and production REST traffic showed zero 401 or 403 responses, so the real app wasn't tripping over the new rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix that would have broken every email signup
&lt;/h2&gt;

&lt;p&gt;One fix deserves its own paragraph, because the obvious version was wrong.&lt;/p&gt;

&lt;p&gt;The function that redeems an invite code should only redeem it for your own account. The obvious rule is "the user in the JWT must be the account being redeemed for". But with email signups, the redeem runs right after the account is created, before the email is confirmed, so there's no session yet. The obvious rule would have rejected every email signup.&lt;/p&gt;

&lt;p&gt;The real rule has two branches. With a session, the JWT user must match. Without one, the account must have been created minutes ago and not be confirmed yet. Writing the "must work" probes first is what showed me that.&lt;/p&gt;

&lt;p&gt;I also added 27 regression tests for the gate in CI (Deno), including a replay of the OAuth bypass I fixed earlier, run against an in-memory fake of Supabase so no real Google account is needed. To check that the tests test something, I removed the ownership check from the code and watched them fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Traps on the way
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;safeupdate&lt;/code&gt; can make a probe fail for the wrong reason.&lt;/strong&gt; Supabase uses &lt;code&gt;pg-safeupdate&lt;/code&gt;, which rejects an &lt;code&gt;UPDATE&lt;/code&gt; without a &lt;code&gt;WHERE&lt;/code&gt;. A "must fail" probe that fails because of it proves nothing about RLS. Always give probes a real filter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My bench ignored column grants at first&lt;/strong&gt; and reported false failures. If you rebuild a schema, rebuild the privileges too, not just the policies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;EXPLAIN&lt;/code&gt; checks privileges without running the query.&lt;/strong&gt; That's a safe way to confirm in production that a role can't touch a column: you get "permission denied" or a plan, and nothing is executed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;supabase db push&lt;/code&gt; wants the database password.&lt;/strong&gt; I applied the migration through the Management API instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The old logs endpoint I'd planned to use returned 410 Gone.&lt;/strong&gt; I verified with gateway logs instead.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Same bench, another project: the NULL in the lobby
&lt;/h2&gt;

&lt;p&gt;I ran the same method the same day on &lt;a href="https://marcoblch.github.io/Kidcapital" rel="noopener noreferrer"&gt;KidCapital&lt;/a&gt;, my money game for kids: around 45 probes, three callers (anonymous, a player targeting another player, a member of a game). The findings went from 18 to 5, and I accepted the 5 that remain. The normal journey (solo game, leaderboard, multiplayer create, join, play, finish, data deletion) passed 18 out of 18 before and after.&lt;/p&gt;

&lt;p&gt;Two bugs from that project are worth stealing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A privacy fix that broke game creation.&lt;/strong&gt; A few days earlier, I'd made multiplayer games visible only to their players, through a membership function. Right after, nobody could create a game. The client inserts a game and asks for the row back (&lt;code&gt;INSERT ... RETURNING&lt;/code&gt;), and the &lt;code&gt;RETURNING&lt;/code&gt; part is checked against the select policy. But the membership function can't see the row that's still being inserted, so the check fails and the whole insert is refused. The fix: let the creator see their own game directly, without the function. Fixed the same day, with an end-to-end test in production passing 8 out of 8.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A guard that said nothing.&lt;/strong&gt; A trigger compared the current user with the player whose turn it is. In the lobby, before the game starts, that player is &lt;code&gt;NULL&lt;/code&gt;. In SQL, &lt;code&gt;x &amp;lt;&amp;gt; NULL&lt;/code&gt; is not true or false. It's &lt;code&gt;NULL&lt;/code&gt;, and an &lt;code&gt;IF&lt;/code&gt; treats it as "don't fire". So the guard was silent exactly when nobody was playing yet. The fix is &lt;code&gt;IS DISTINCT FROM&lt;/code&gt;, which treats &lt;code&gt;NULL&lt;/code&gt; as a value. The bench caught it because it tests the rejection cases, not only the happy path.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell any Supabase builder
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;RLS picks rows. Use column-level grants for the columns your server trusts.&lt;/li&gt;
&lt;li&gt;Never trust &lt;code&gt;user_metadata&lt;/code&gt; for roles or permissions. The user can edit it. Use &lt;code&gt;app_metadata&lt;/code&gt; (set with &lt;code&gt;service_role&lt;/code&gt;) or your own table.&lt;/li&gt;
&lt;li&gt;Audit a copy, not production, and prove the copy is faithful with a fingerprint of &lt;code&gt;pg_policies&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Write "must work" probes next to "must fail" ones. They're what stop a security fix from breaking signup.&lt;/li&gt;
&lt;li&gt;Test your rollback before you need it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The person who asked about the back door was right. The best thing about building in public is that people ask the question you were avoiding.&lt;/p&gt;

</description>
      <category>supabase</category>
      <category>postgres</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>My Black Friday Dry Run Would Have Billed 3,334 Users in the Wrong Currency</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Tue, 03 Nov 2026 18:43:09 +0000</pubDate>
      <link>https://dev.to/marcoblch/my-black-friday-dry-run-would-have-billed-3334-users-in-the-wrong-currency-809</link>
      <guid>https://dev.to/marcoblch/my-black-friday-dry-run-would-have-billed-3334-users-in-the-wrong-currency-809</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/black-friday-dry-run-americans-billed-in-euros/" rel="noopener noreferrer"&gt;meridianbuild.dev&lt;/a&gt;, my build log for &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;, an AI outfit planner that works from the clothes you already own.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On October 30 I set up the Black Friday offer for &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;: Premium annual for 39 € / $39 / £35 for the first year, instead of 59.99 / 59.99 / 49.99. It runs from November 25 to November 30, with two emails, a banner and a one-click checkout link.&lt;/p&gt;

&lt;p&gt;Before writing any copy, I ran the email audience as a dry run. Not "send to myself". I asked the code: for every user who would receive this email, which price would they see and which currency would Stripe charge?&lt;/p&gt;

&lt;p&gt;The answer was that 3,334 of the 3,691 accounts would be priced in euros. Most of my users are in the US.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the euros came from
&lt;/h2&gt;

&lt;p&gt;OutfitMaker sells in EUR, USD and GBP. On the website, the currency comes from the request: the visitor's location and language. That part was fine and had been fine since early October.&lt;/p&gt;

&lt;p&gt;Outside a web request, there's no visitor. An email, a background job or a signed checkout link has to decide from the database. I added a &lt;code&gt;currency&lt;/code&gt; column to &lt;code&gt;users&lt;/code&gt; on October 12, set every time someone visits the site. Accounts created before that, or people who hadn't come back since, had an empty column.&lt;/p&gt;

&lt;p&gt;And empty meant the default, which is EUR. That's 3,334 people, so 90 % of the list.&lt;/p&gt;

&lt;p&gt;In practice, an American would have opened an email saying "39 €", clicked the link and landed on a Stripe Checkout in euros. Some might have paid anyway. I suspect most would have closed the tab. Nothing would have crashed, and no error would have shown up in a log. It would just have been a worse Black Friday, and I would probably have blamed the offer.&lt;/p&gt;

&lt;h2&gt;
  
  
  A currency from the time zone
&lt;/h2&gt;

&lt;p&gt;I didn't have a country for those accounts. But I had something almost as good: their time zone, which the app already stores to work out local times.&lt;/p&gt;

&lt;p&gt;A time zone isn't a country, but it's close enough to pick between three currencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;currency_for_time_zone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;zone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;iana_zone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt; &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="n"&gt;zone&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"GBP"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;GBP_ZONES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"EUR"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_with?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Europe/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="no"&gt;EURO_ZONES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="s2"&gt;"USD"&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;iana_zone&lt;/code&gt; does the tedious part. Rails stores friendly names like &lt;code&gt;"Eastern Time (US &amp;amp; Canada)"&lt;/code&gt;, so they get mapped back to IANA names (&lt;code&gt;America/New_York&lt;/code&gt;). Old aliases get normalized. And &lt;code&gt;UTC&lt;/code&gt;, &lt;code&gt;Etc/*&lt;/code&gt; and blank values return &lt;code&gt;nil&lt;/code&gt;, because they say nothing about where someone lives.&lt;/p&gt;

&lt;p&gt;When the time zone is useless, the language decides: English reads as an American account, which matches most of my traffic, and French, German, Spanish, Portuguese and Italian read as euros. Only when both are missing does the old default apply.&lt;/p&gt;

&lt;p&gt;The order of trust is now explicit, in one method on &lt;code&gt;User&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;effective_currency&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;currency&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;PriceBook&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;CURRENCIES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="no"&gt;PriceBook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;currency_for_time_zone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time_zone&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="no"&gt;PriceBook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;currency_for_locale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="no"&gt;PriceBook&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;DEFAULT&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First the currency the person was actually shown on the site, then the time zone, then the language, then EUR. Every email, job and checkout link calls this, and none of them read the raw column any more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Backfilling without overwriting anyone
&lt;/h2&gt;

&lt;p&gt;I also wanted the column filled in, so the site, the emails and the checkout agree from now on. The backfill is a one-off rake task, and it has three rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It only touches users whose currency is blank.&lt;/li&gt;
&lt;li&gt;The write checks again that the column is still blank. If someone visits the site between the read and the write, their real currency wins.&lt;/li&gt;
&lt;li&gt;It runs as a dry run by default and returns the counts per currency.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;dry_run: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;ids_by_currency&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Hash&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&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="n"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:currency&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:time_zone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:locale&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;find_each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;ids_by_currency&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;effective_currency&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="n"&gt;dry_run&lt;/span&gt;
    &lt;span class="n"&gt;ids_by_currency&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
      &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each_slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;slice&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;id: &lt;/span&gt;&lt;span class="n"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;update_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;currency: &lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="n"&gt;ids_by_currency&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transform_values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="ss"&gt;:size&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_h&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;scope&lt;/code&gt; is &lt;code&gt;User.where(currency: [nil, ""])&lt;/code&gt;, and it's reapplied inside the &lt;code&gt;update_all&lt;/code&gt;. That's what makes it idempotent and safe to rerun.&lt;/p&gt;

&lt;p&gt;After the fix, the full user base splits into 2,192 USD, 1,317 EUR and 182 GBP. That looks like my traffic, which is the sanity check I care about.&lt;/p&gt;

&lt;h2&gt;
  
  
  One coupon, three exact amounts
&lt;/h2&gt;

&lt;p&gt;The second trap was on the Stripe side. My annual Premium price is a single Stripe Price in EUR with &lt;code&gt;currency_options&lt;/code&gt; for USD and GBP. I didn't want a separate Black Friday price, because then renewals would need special handling.&lt;/p&gt;

&lt;p&gt;So the discount is a coupon on the normal price. It has &lt;code&gt;duration: "once"&lt;/code&gt;, so only the first invoice is discounted and the renewal is the normal annual amount. And it uses an &lt;code&gt;amount_off&lt;/code&gt; per currency, through the coupon's own &lt;code&gt;currency_options&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;EUR: 59.99 minus 39.00 = 20.99 off (on the coupon itself)&lt;/li&gt;
&lt;li&gt;USD: 59.99 minus 39.00 = 20.99 off&lt;/li&gt;
&lt;li&gt;GBP: 49.99 minus 35.00 = 14.99 off&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A percentage coupon would have been simpler, but it would give £34.99 instead of £35 and 39.00 only by luck of rounding. With &lt;code&gt;amount_off&lt;/code&gt; per currency, the first invoice is exactly the number in the email.&lt;/p&gt;

&lt;p&gt;The code creates the coupon the first time it's needed and checks it on every use. If the amounts on Stripe ever drift from the ones in the code, because someone edited the coupon in the dashboard or because of a bad deploy, the checkout refuses to open. I'd rather lose one sale than charge a price I never announced.&lt;/p&gt;

&lt;h2&gt;
  
  
  The window is in New York time
&lt;/h2&gt;

&lt;p&gt;The last detail is the clock. The offer ends at the end of November 30 in New York, which is 05:59 on December 1 in Paris. The window is defined once, in &lt;code&gt;America/New_York&lt;/code&gt;, and the code switches itself on and off. There's nothing to deploy on the day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Before sending any email that shows a price, dry-run the audience and count which price each person would see. It takes a minute and it found 3,334 wrong prices.&lt;/li&gt;
&lt;li&gt;"Default currency" is a decision, not a fallback. If most of your users aren't in the default, the default is a bug waiting for an email.&lt;/li&gt;
&lt;li&gt;A time zone is a decent proxy for a country when you only need to choose between a few currencies. Treat &lt;code&gt;UTC&lt;/code&gt; and blanks as unknown, not as a location.&lt;/li&gt;
&lt;li&gt;Backfills should only fill blanks, check again at write time, and dry-run by default.&lt;/li&gt;
&lt;li&gt;For a discount in several currencies, use &lt;code&gt;amount_off&lt;/code&gt; per currency in &lt;code&gt;currency_options&lt;/code&gt; on a &lt;code&gt;once&lt;/code&gt; coupon, and refuse the checkout if the coupon drifts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The offer starts November 25. At least now everyone will see it in their own money.&lt;/p&gt;

</description>
      <category>rails</category>
      <category>stripe</category>
      <category>saas</category>
      <category>startup</category>
    </item>
    <item>
      <title>93 Paid Clicks, Zero Signups: My Google Button Doesn't Work Inside TikTok</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Mon, 02 Nov 2026 07:56:03 +0000</pubDate>
      <link>https://dev.to/marcoblch/93-paid-clicks-zero-signups-my-google-button-doesnt-work-inside-tiktok-4i48</link>
      <guid>https://dev.to/marcoblch/93-paid-clicks-zero-signups-my-google-button-doesnt-work-inside-tiktok-4i48</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/93-paid-clicks-zero-signups-google-button-tiktok/" rel="noopener noreferrer"&gt;meridianbuild.dev&lt;/a&gt;, my build log for &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;, an AI outfit planner that works from the clothes you already own.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On October 30 I looked at the results of a small TikTok ad for &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;. It had cost 21 € and brought 93 visits, so about 0.23 € per visit. 73 % of those visitors were in the US and 97 % were women, which is the audience I asked for.&lt;/p&gt;

&lt;p&gt;Signups from those 93 visits: zero.&lt;/p&gt;

&lt;p&gt;That would be a normal result for a bad ad. But over the same 7 days, the site as a whole turned 5,252 visits into 1,042 signups. That's 19.8 %, roughly one visitor in five. At that rate, 93 visitors should give somewhere around 18 signups. Zero is not bad luck. Something was broken, and only for those visitors.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the TikTok visitors had in common
&lt;/h2&gt;

&lt;p&gt;The ad audience was not perfect. The age targeting didn't hold: 63 % of the visitors were 18 to 24, which is my weakest age group for payments. But that age group signs up fine. It just doesn't pay. Age could explain zero sales. It could not explain zero accounts.&lt;/p&gt;

&lt;p&gt;The thing every one of those 93 people shared was the browser. When you tap a link in a TikTok ad, the page doesn't open in Safari or Chrome. It opens inside TikTok, in an embedded webview. Instagram and Facebook do the same.&lt;/p&gt;

&lt;p&gt;And the first button on my sign-up page was "Continue with Google".&lt;/p&gt;

&lt;h2&gt;
  
  
  Google says no to webviews
&lt;/h2&gt;

&lt;p&gt;Google's sign-in refuses to run inside embedded webviews. If you start a Google OAuth flow from one, you don't get the account picker. You get an error page: &lt;code&gt;Error 403: disallowed_useragent&lt;/code&gt;. Google's reason is security: an app that hosts a webview can see everything typed into it, including a password.&lt;/p&gt;

&lt;p&gt;So from inside TikTok, my funnel was:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;See the ad, tap it.&lt;/li&gt;
&lt;li&gt;Land on a page whose biggest button is Google.&lt;/li&gt;
&lt;li&gt;Tap it, get a Google error page in English talking about user agents.&lt;/li&gt;
&lt;li&gt;Leave.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The email form was right below the button, and it works fine in a webview. But a person who just hit an error page doesn't scroll down to try plan B. They close the page and go back to their feed.&lt;/p&gt;

&lt;p&gt;I can't prove that this was the cause for all 93 visits. I didn't have tracking on in-app sign-up views at the time, which is exactly the problem I fixed next. But it's the one thing that was different for those visitors, it was the first thing they'd tap, and it fails 100 % of the time in that browser. I shipped the fix the same day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detecting the in-app browser
&lt;/h2&gt;

&lt;p&gt;There's no API for "am I in a webview". The only signal is the User-Agent, and each app adds its own token. Here is the module, more or less as it is in production:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;InAppBrowser&lt;/span&gt;
  &lt;span class="no"&gt;RULES&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="ss"&gt;:tiktok&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sr"&gt;/musical_ly|BytedanceWebview|TikTok/&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:instagram&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sr"&gt;/Instagram/&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:facebook&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sr"&gt;/FBAN|FBAV|FB_IAB/&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:snapchat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sr"&gt;/Snapchat/&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:linkedin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sr"&gt;/LinkedInApp/&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:other_webview&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sr"&gt;/; wv\)/&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;freeze&lt;/span&gt;

  &lt;span class="kp"&gt;module_function&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;detect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_agent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;user_agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;

    &lt;span class="no"&gt;RULES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_agent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kp"&gt;nil&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The order matters. On Android, the Instagram and Facebook User-Agents also contain &lt;code&gt;; wv)&lt;/code&gt;, the generic Android WebView marker. If the generic rule came first, every Instagram visitor would be labelled "other webview". It goes last as a catch-all.&lt;/p&gt;

&lt;p&gt;User-Agent sniffing is fragile, and I know it. Apps change their strings. But the failure mode here is gentle. If detection misses a webview, the visitor sees the old page, which is what everyone saw before. If it wrongly flags a real browser, that visitor loses the Google button but still has a working email form. Neither mistake locks anyone out.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the page does now
&lt;/h2&gt;

&lt;p&gt;A concern exposes the result to the Devise sign-up and sign-in views:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;InAppBrowserDetection&lt;/span&gt;
  &lt;span class="kp"&gt;extend&lt;/span&gt; &lt;span class="no"&gt;ActiveSupport&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Concern&lt;/span&gt;

  &lt;span class="n"&gt;included&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;helper_method&lt;/span&gt; &lt;span class="ss"&gt;:in_app_browser&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:in_app_android?&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="kp"&gt;private&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;in_app_browser&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="vi"&gt;@in_app_browser&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;defined?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vi"&gt;@in_app_browser&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="vi"&gt;@in_app_browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;InAppBrowser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;detect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;user_agent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside TikTok, Instagram or Facebook, the page changes in three ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google is hidden.&lt;/strong&gt; A button that can only produce an error page is worse than no button.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Email goes first.&lt;/strong&gt; The form that works is the first thing you see.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A short tip explains how to get Google back&lt;/strong&gt;: open the page in your real browser. On Android, there's a one-tap link that uses a Chrome intent URL (&lt;code&gt;intent://...;package=com.android.chrome;end&lt;/code&gt;) to reopen the same page in Chrome. iOS has no reliable equivalent, so iOS visitors only get the text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tip can be dismissed, and the dismissal is remembered, so it doesn't nag.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring it this time
&lt;/h2&gt;

&lt;p&gt;The other half of the fix is that I can now see this funnel. Each sign-up page view inside a webview fires an &lt;code&gt;in_app_signup_view&lt;/code&gt; event with the app name. Each signup made inside a webview carries an &lt;code&gt;in_app&lt;/code&gt; property on the existing &lt;code&gt;Signup&lt;/code&gt; event. Those two numbers give me a conversion rate for each app, which is what I was missing on October 30. I only had a total of zero.&lt;/p&gt;

&lt;p&gt;That's the lesson I'd keep even without the webview part: &lt;strong&gt;when you pay for traffic, check that the page works in the browser that traffic actually uses.&lt;/strong&gt; I tested my sign-up page in Chrome, Safari and Firefox, on desktop and on a phone. I never opened it from inside the app that I was paying to send people from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If your traffic comes from TikTok, Instagram or Facebook, your page opens in their webview. Test it there, by tapping your own link inside the app.&lt;/li&gt;
&lt;li&gt;Google OAuth doesn't work in those webviews. If Google is your first or only sign-in option, those visitors hit an error page.&lt;/li&gt;
&lt;li&gt;Detect the webview from the User-Agent, put the generic Android &lt;code&gt;; wv)&lt;/code&gt; rule last, and make sure a wrong guess fails gently.&lt;/li&gt;
&lt;li&gt;Measure the in-app funnel separately. A blended conversion rate of 19.8 % hid a channel that was converting at zero.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;21 € is cheap tuition. The expensive version of this story is the one where you scale the ad first.&lt;/p&gt;

</description>
      <category>rails</category>
      <category>webdev</category>
      <category>startup</category>
      <category>growth</category>
    </item>
    <item>
      <title>A QA Checklist for a Recurring AI Character</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Tue, 27 Oct 2026 17:09:17 +0000</pubDate>
      <link>https://dev.to/marcoblch/a-qa-checklist-for-a-recurring-ai-character-5423</link>
      <guid>https://dev.to/marcoblch/a-qa-checklist-for-a-recurring-ai-character-5423</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/qa-checklist-for-a-recurring-ai-character/" rel="noopener noreferrer"&gt;meridianbuild.dev&lt;/a&gt;, my build log for &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;, an AI outfit planner that works from the clothes you already own.&lt;br&gt;
&lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt; has a recurring character on TikTok and Instagram. Her name is Dot. She is a stylist with short cropped grey hair, gold hoops, a black fine knit turtleneck and a small terracotta brooch, and she works in a London townhouse atelier with a brass clothing rail and a velvet armchair. Every episode, a client comes in with a closet problem and leaves with three outfits.&lt;br&gt;
Dot does not exist. Every image is generated with Gemini's image model, from reference pictures and a prompt. That makes her cheap to produce and very easy to break.&lt;br&gt;
This post is the checklist I run before anything with Dot in it goes out, and what today's batch of nine images taught me about where image models drift.&lt;/p&gt;
&lt;h2&gt;
  
  
  How an image is made
&lt;/h2&gt;

&lt;p&gt;Each shot is one request with three reference photos and a prompt:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dot&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;text: &lt;/span&gt;&lt;span class="s2"&gt;"PHOTO A: 'Dot', our recurring stylist (character sheet). Keep her EXACT face, short cropped grey hair, gold hoop earrings, small round terracotta enamel brooch."&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;room&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;text: &lt;/span&gt;&lt;span class="s2"&gt;"PHOTO B: the atelier. Keep the EXACT room: Georgian London townhouse, tall sash windows, ..."&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;refs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"dot_sheet.png"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;room&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"place_1.png"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="n"&gt;refs&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="ss"&gt;text: &lt;/span&gt;&lt;span class="s2"&gt;"PHOTO C: the client. Keep her EXACT face, hair, skin tone and body."&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="n"&gt;enc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client_photo&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Photo A is a character sheet of Dot from several angles. Photo B is the room. Photo C is the client, and the client is one of the stock models the app already uses for its own try-on previews, so the series and the product show the same people.&lt;br&gt;
The script runs inside the production container, because that is where the API key and the stock model photos already live, and it writes PNGs to &lt;code&gt;/tmp&lt;/code&gt;. Nothing touches the database. A slideshow is five slides: a hook, three looks, and an end slide with Dot alone.&lt;/p&gt;
&lt;h2&gt;
  
  
  The three rules
&lt;/h2&gt;

&lt;p&gt;All three came from episodes that went wrong before this checklist existed.&lt;br&gt;
&lt;strong&gt;1. The client must not look like Dot.&lt;/strong&gt; In one early episode the client was a light skinned woman in her fifties. The model blended her with Dot: same face shape, and her hair got shorter and greyer from one look to the next. Two women who looked like sisters, in a series where one is supposed to be the expert and the other the customer. My reaction when I saw it was one word in French: bizarre.&lt;br&gt;
&lt;strong&gt;2. The client keeps the same face and hair across all looks.&lt;/strong&gt; In another episode the second look had a different woman in it. Same outfit brief, different person. Image models do not have a notion of "the same client as in the previous request". Every request is a fresh roll, and only the reference photo holds her identity.&lt;br&gt;
&lt;strong&gt;3. Dot never wears a coat.&lt;/strong&gt; Her silhouette is the turtleneck. Once she has a camel coat on, she reads as a different character in a thumbnail, and thumbnails are all TikTok gives you.&lt;br&gt;
These go in the prompt as hard constraints:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;two&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"TWO DIFFERENT WOMEN: the client is the woman from PHOTO C (keep her exact face, skin tone, body and EXACTLY the same hairstyle as in PHOTO C; she looks nothing like Dot); Dot is the short-grey-haired stylist from PHOTO A. "&lt;/span&gt;
&lt;span class="n"&gt;dotlook&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;" Dot stands slightly behind on the left wearing ONLY a black fine-knit turtleneck and black slim trousers, NO coat, NO jacket, no outerwear at all, arms relaxed or adjusting a detail of the outfit, closed lips."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Putting rules in a prompt is necessary. It is not sufficient. The model follows them most of the time, and "most of the time" across nine images means something will fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Today's batch: nine images, six rejected
&lt;/h2&gt;

&lt;p&gt;I generated two slideshows: "outfits for people with a full closet and nothing to wear" and "the white shirt you never wear, 3 ways". Eight shots with a client, plus the shared end slide. The first pass came back clean on the technical side: nine images, no API errors, no retries.&lt;br&gt;
Then the contact sheet. I tile every image of a batch into one picture with ffmpeg so I can review them side by side, because drift is invisible one image at a time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg &lt;span class="nt"&gt;-i&lt;/span&gt; s1_0.png &lt;span class="nt"&gt;-i&lt;/span&gt; s1_1.png ... &lt;span class="nt"&gt;-filter_complex&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"[0]scale=360:640[v0];[1]scale=360:640[v1];...;&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
   [v0][v1]...xstack=inputs=9:layout=0_0|360_0|720_0|..."&lt;/span&gt; contact.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is what failed.&lt;br&gt;
&lt;strong&gt;Dot wore a coat in three images.&lt;/strong&gt; Two were the opening "before" shots of each slideshow. Looking at the script, that was my bug, not the model's: the no coat sentence was appended to the three look shots and not to the opening shot, where Dot only appears as a side character. The model gave her a camel coat because nothing said otherwise. The third was the end slide, where my own prompt asked for "her long camel coat over her shoulders". I had written that before the rule existed and never reread it.&lt;br&gt;
&lt;strong&gt;The client of the first slideshow was too close to Dot.&lt;/strong&gt; The stock model I had picked has a grey bob. Next to Dot's grey crop, the two women had the same palette from head to shoulders. No blending this time, faces were distinct, but in a 360 pixel thumbnail it failed rule 1 anyway. I swapped her for a different stock model with dark skin and short natural hair. That meant regenerating all four shots of that slideshow, because rule 2 says the client cannot change halfway.&lt;br&gt;
&lt;strong&gt;The end slide had a flat beige band across the top quarter.&lt;/strong&gt; This one surprised me. Every prompt ends with a style block that includes "leave calm empty wall space in the top third of the picture", because the hook text goes there. On the shots with two people, the model reads that as composition advice and pulls the camera back. On the end slide, with Dot alone, it painted a literal empty rectangle above the room, like a letterbox. It did it twice in a row.&lt;br&gt;
&lt;strong&gt;Dot smiled with her teeth.&lt;/strong&gt; The prompt said "warm closed-lip smile". She smiled with her teeth anyway, on the end slide, both times.&lt;/p&gt;
&lt;h2&gt;
  
  
  Fixing the prompt, not the picture
&lt;/h2&gt;

&lt;p&gt;I could have cropped the band out or picked the least bad image. I would rather fix the prompt, because the same prompt will run for the next eight slideshows.&lt;br&gt;
The opening shots got the same constraint as the look shots:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dotsolo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;" Dot wears ONLY a black fine-knit turtleneck and black slim trousers, NO coat, NO jacket, no outerwear at all, closed lips."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The end slide got its own variant of the style block. The "empty space" instruction is replaced by one that describes the room going up to the ceiling, and the smile is described physically instead of with an adjective:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"end"&lt;/span&gt;
  &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"leave calm empty wall space in the top third of the picture"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                      &lt;span class="s2"&gt;"the room continues naturally up to the ceiling cornice"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
           &lt;span class="s2"&gt;" Her mouth is fully closed: a soft gentle smile with lips pressed together, absolutely no teeth visible."&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Closed-lip smile" failed twice. "Lips pressed together, no teeth visible" worked on the first try. Describing what the camera should see beats naming the expression.&lt;br&gt;
I also added one line that is not about the picture at all: the script now prints the list of available stock models before generating, so picking a client is a deliberate choice from the real list and not a key I remember.&lt;/p&gt;
&lt;h2&gt;
  
  
  Regenerate only what failed
&lt;/h2&gt;

&lt;p&gt;The script takes an &lt;code&gt;ONLY&lt;/code&gt; variable, so a rerun touches just the rejected shots and leaves the approved ones alone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;only&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ONLY"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;","&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;shots&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="k"&gt;next&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;only&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;only&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="c1"&gt;# ...&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before every rerun I copy the current images to a versioned folder. Image models do not always improve on a second try, and I want to be able to go back.&lt;br&gt;
The final count for two slideshows: 9 images in the first pass, 6 regenerated, 1 regenerated again. Sixteen generations for nine images that ship. That ratio is the real cost of a recurring character, and it is still far cheaper than a photo shoot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Text goes on after review
&lt;/h2&gt;

&lt;p&gt;The hook text, the look labels and the end slide are added afterwards with Remotion stills, not by the image model. Image models are getting better at text, but a typo baked into an image means regenerating the image. In Remotion it is a string.&lt;br&gt;
The same component renders both formats: 9:16 for TikTok, and 4:5 for Instagram, where the 9:16 image is fitted by height on a sand background so no head or shoe is ever cropped. Overlays sit in the wall space above the people, which is exactly what that "empty top third" instruction was for when it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;p&gt;Before anything with Dot goes out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build the contact sheet. Never review generated images one at a time.&lt;/li&gt;
&lt;li&gt;Client vs Dot: different face, different hair, different palette, judged at thumbnail size.&lt;/li&gt;
&lt;li&gt;Same client, same hair, in every look of a slideshow.&lt;/li&gt;
&lt;li&gt;Dot: turtleneck, no coat, no jacket, lips closed.&lt;/li&gt;
&lt;li&gt;Look for composition artifacts: blank bands, extra people, duplicated limbs, text the model invented.&lt;/li&gt;
&lt;li&gt;Reject, fix the prompt, rerun only the failures, review again.
None of this is clever. It is the same thing as reviewing a pull request: the model writes, a person reads, and the rules that matter are written down so they survive the next batch. If you want the other side of how OutfitMaker uses Gemini, &lt;a href="https://meridianbuild.dev/blog/my-ai-was-blind-in-production/" rel="noopener noreferrer"&gt;my AI was blind in production&lt;/a&gt; is what happens when nobody looks at the images at all.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>testing</category>
      <category>indiehacker</category>
    </item>
    <item>
      <title>Ten Abandoned Checkouts and the One Email I Send Now</title>
      <dc:creator>MarcoBlch</dc:creator>
      <pubDate>Tue, 27 Oct 2026 17:05:14 +0000</pubDate>
      <link>https://dev.to/marcoblch/ten-abandoned-checkouts-and-the-one-email-i-send-now-4bg6</link>
      <guid>https://dev.to/marcoblch/ten-abandoned-checkouts-and-the-one-email-i-send-now-4bg6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on &lt;a href="https://meridianbuild.dev/blog/one-email-for-an-abandoned-checkout/" rel="noopener noreferrer"&gt;meridianbuild.dev&lt;/a&gt;, my build log for &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt;, an AI outfit planner that works from the clothes you already own.&lt;br&gt;
On October 20 I counted the Stripe Checkouts that &lt;a href="https://outfitmaker.ai" rel="noopener noreferrer"&gt;OutfitMaker&lt;/a&gt; had opened over the previous 14 days. There were 11. One was paid. The other 10 people reached the Stripe page, looked at it, and left.&lt;br&gt;
Ten is a small number. But each of those people had already decided they wanted something enough to click "pay". They are the warmest leads I have, and I had an email for them. It just didn't see most of them.&lt;br&gt;
This post covers how I rebuilt that email in PR #245. It also covers a small card that shows the cheapest offer earlier, and why I can't tell you yet whether any of it works.&lt;/p&gt;
&lt;h2&gt;
  
  
  What the old email could see
&lt;/h2&gt;

&lt;p&gt;The previous version of &lt;code&gt;SendCheckoutRecoveryJob&lt;/code&gt; looked for abandoned checkouts in the subscriptions table:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Subscription&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;status: :incomplete&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;stripe_subscription_id: &lt;/span&gt;&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;current_period_end: &lt;/span&gt;&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;created_at: &lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hours&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ago&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hours&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ago&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That query finds people who clicked "start my trial" and never came back from Stripe. It made sense when a subscription was the only thing you could buy.&lt;br&gt;
It isn't anymore. Since then I added a 7-day pass, a one-time payment, and credit packs for Look Previews and resale photos. None of those create a &lt;code&gt;Subscription&lt;/code&gt; row. So someone who opened the pass checkout and walked away was invisible to the job. The email also linked to the pricing page, which meant the person had to find and choose their offer all over again.&lt;br&gt;
If you have read &lt;a href="https://meridianbuild.dev/blog/the-failed-payments-my-database-invented/" rel="noopener noreferrer"&gt;the failed payments my database invented&lt;/a&gt;, the &lt;code&gt;incomplete&lt;/code&gt; status will look familiar. Using a subscription status to mean "someone opened a checkout" was the same kind of shortcut. It works until the product changes shape.&lt;/p&gt;
&lt;h2&gt;
  
  
  A row for every Checkout
&lt;/h2&gt;

&lt;p&gt;The fix starts with a boring table. Every Stripe Checkout session the app opens for a user now gets a row:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;create_table&lt;/span&gt; &lt;span class="ss"&gt;:checkout_attempts&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;references&lt;/span&gt; &lt;span class="ss"&gt;:user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;foreign_key: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;on_delete: :cascade&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="ss"&gt;index: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:stripe_session_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:plan&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;        &lt;span class="c1"&gt;# week_pass, monthly, yearly, or a CreditPurchase::PACKS key&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:source&lt;/span&gt;                   &lt;span class="c1"&gt;# Stripe metadata source (home_card, recovery_email...)&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:currency&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;datetime&lt;/span&gt; &lt;span class="ss"&gt;:completed_at&lt;/span&gt;           &lt;span class="c1"&gt;# checkout.session.completed webhook&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;datetime&lt;/span&gt; &lt;span class="ss"&gt;:recovery_email_sent_at&lt;/span&gt; &lt;span class="c1"&gt;# claimed by the recovery job, once&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timestamps&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I could have asked Stripe for the list of expired sessions on every run instead. I didn't want a cron job that depends on paging through an external API to decide who gets an email. A local row is easier to query and easier to test, and it doesn't care what kind of product was in the cart.&lt;br&gt;
The recording happens in one place. All Checkouts already went through a small &lt;code&gt;StripeCheckout&lt;/code&gt; module, so I split it in two:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_session&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="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;open_session&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="no"&gt;CheckoutAttempt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;record!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&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="n"&gt;session&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One choke point means no entry point can forget to record. And &lt;code&gt;record!&lt;/code&gt; never raises. It logs a warning and returns &lt;code&gt;nil&lt;/code&gt; if the insert fails, because a recovery email is not worth losing the checkout itself.&lt;br&gt;
The &lt;code&gt;checkout.session.completed&lt;/code&gt; webhook stamps &lt;code&gt;completed_at&lt;/code&gt;. That covers paid sessions and also payment methods that are still settling. Either way, the person finished on Stripe's side and should not get a "you didn't finish" email.&lt;/p&gt;
&lt;h2&gt;
  
  
  One email, and the window
&lt;/h2&gt;

&lt;p&gt;The new job runs every 30 minutes and looks for unfinished Checkouts that were opened between 60 and 180 minutes ago:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;RECOVERY_AGE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;minutes&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;minutes&lt;/span&gt;
&lt;span class="no"&gt;RECOVERY_COOLDOWN&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;days&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;recoverable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;unfinished&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;recovery_email_sent_at: &lt;/span&gt;&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;created_at: &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;RECOVERY_AGE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;RECOVERY_AGE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The old window was 3 to 24 hours. I moved it much earlier. An hour is long enough that the person has clearly left and isn't just reading the Stripe page or switching cards. It's still short enough that they remember what they were doing. The cron runs at :20 and :50, which lands about an hour after the abandon and keeps it away from other jobs that fire on the hour and half hour.&lt;br&gt;
There is exactly one email per abandoned session, and at most one per user per 7 days. No sequence. No "last chance" follow up. The subject is "You were one tap away", and the footer says plainly that this is the only reminder.&lt;br&gt;
I went with one email on purpose. These are people who signed up days or minutes ago, and they already get onboarding emails. A recovery sequence on top of that is how a small app ends up in the spam folder. I would rather lose a sale than teach Gmail that my domain sends three emails about the same unfinished payment.&lt;/p&gt;
&lt;h2&gt;
  
  
  The link reopens the same offer
&lt;/h2&gt;

&lt;p&gt;The email shows what the person was about to get and has one button. That button doesn't go to the pricing page. It reopens the same offer through a signed one-click link:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="vi"&gt;@cta_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;renew_subscriptions_url&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="no"&gt;HOST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;token: &lt;/span&gt;&lt;span class="no"&gt;PassMailer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;renewal_token&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="ss"&gt;plan: &lt;/span&gt;&lt;span class="vi"&gt;@plan&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                           &lt;span class="ss"&gt;source: &lt;/span&gt;&lt;span class="s2"&gt;"recovery_email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;utm_source: &lt;/span&gt;&lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                           &lt;span class="ss"&gt;utm_medium: &lt;/span&gt;&lt;span class="s2"&gt;"checkout_recovery"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;utm_content: &lt;/span&gt;&lt;span class="vi"&gt;@plan&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The renew endpoint already existed for pass renewals. It verifies the token, so the person doesn't have to log in from their phone, and it opens a fresh Checkout for the plan they picked: the week pass, monthly, yearly, or the exact credit pack. If they were eligible for the free trial week, the email says so, and the button says "Start my free week" instead of "Get Premium".&lt;br&gt;
The new Checkout carries &lt;code&gt;source: "recovery_email"&lt;/code&gt; in its Stripe metadata. That's the only way I'll ever know if the email works.&lt;br&gt;
There is no countdown, no discount, and no deadline in the email. The offer is simply still there. I don't want to train people to abandon a checkout to get a coupon.&lt;/p&gt;
&lt;h2&gt;
  
  
  Most of the code is reasons not to send
&lt;/h2&gt;

&lt;p&gt;The query that finds candidates is three lines. The rules that stop the email take up most of the job:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;recover?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;user&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt; &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recoverable_user?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkout_attempts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"created_at &amp;gt; ?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;exists?&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;CheckoutAttempt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recovery_sent_recently?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;paid_since?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="no"&gt;LifecycleEmailGuard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sent_today?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In plain words, no email if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;They came back.&lt;/strong&gt; A newer Checkout means they returned on their own, so only the latest one counts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They paid some other way.&lt;/strong&gt; That could be a pass or a pack bought in another session, or with the express payment sheet. &lt;code&gt;paid_since?&lt;/code&gt; looks for purchases created after this Checkout opened. An older purchase doesn't count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They are already Premium.&lt;/strong&gt; This covers a live trial, an active subscription or a pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The inbox isn't confirmed&lt;/strong&gt;, or they turned off lifecycle emails. The daily outfit email has its own switch, and turning that one off doesn't block this email. The recovery email is closer to marketing, so it follows the marketing switch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's an internal account.&lt;/strong&gt; My own account, QA accounts and demo accounts are all excluded, from both emails and conversion stats.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They already got an email today.&lt;/strong&gt; OutfitMaker allows one lifecycle email per user per day. If the daily outfit or an activation email already went out, the recovery waits. While a recovery email is pending, the softer emails stand down for it.
Then there's the lock. Two runs of the job, or a retry, must never send twice. So the row itself is the lock:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;claim!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="no"&gt;CheckoutAttempt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;id: &lt;/span&gt;&lt;span class="n"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;recovery_email_sent_at: &lt;/span&gt;&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                 &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;recovery_email_sent_at: &lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;updated_at: &lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only the run that flips &lt;code&gt;recovery_email_sent_at&lt;/code&gt; from &lt;code&gt;nil&lt;/code&gt; gets to send. It's the same conditional update pattern I'd use for anything that must happen once, and it doesn't need Redis. The old version kept its "already sent" flag in the Rails cache, which a flush could erase.&lt;br&gt;
The tests read like that list: "timing: nothing before an hour, nothing after three", "only the latest checkout of a user counts", "an older purchase does not count as paying for this checkout", "skips internal and QA accounts".&lt;/p&gt;

&lt;h2&gt;
  
  
  Showing the pass earlier
&lt;/h2&gt;

&lt;p&gt;The second half of the PR is about the other end of the funnel. The cheapest offer is the 7-day pass, and almost nobody was seeing it.&lt;br&gt;
Over those same 14 days, there were about 1,700 signups. Only about 100 of them reached the paywall that appears after the first free Look Preview. That's the moment where the pass was offered. Everyone else never saw a price.&lt;br&gt;
So free users with at least 3 real pieces in their closet (sample items don't count) now see a small card on the home page: 7 days of Premium, one payment, nothing renews. One tap opens the week pass Checkout. A "Hide for a week" button sets a cookie and the card goes away for 7 days. The d1 and d3 activation emails got a one-line mention of the pass too.&lt;br&gt;
I track the card as its own experiment label, &lt;code&gt;home_pass_card&lt;/code&gt;, with a single arm. It isn't an A/B test. I only wanted its views, taps and purchases to go through the same report as the main paywall without mixing into that paywall's numbers. A view is recorded once per user, however many times the home page renders. A tap is recorded on the server, inside the checkout request, and only for a user who was shown the card.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I don't know yet
&lt;/h2&gt;

&lt;p&gt;This shipped on October 20. As I write this, it's too early to measure anything. Ten abandoned Checkouts in two weeks means I'll need weeks of data before a recovered sale means anything. I don't have a before/after number, and I'm not going to invent one.&lt;br&gt;
What I do have is the instrumentation to find out. Every Checkout now has a row with a source. A recovered sale will come back tagged &lt;code&gt;recovery_email&lt;/code&gt; and a pass bought from the card will come back tagged &lt;code&gt;home_card&lt;/code&gt;. If neither moves, that's an answer too.&lt;br&gt;
The broader lesson is the same one from &lt;a href="https://meridianbuild.dev/blog/payment-screens-promised-what-the-code-did-not-do/" rel="noopener noreferrer"&gt;the week my payment screens promised things my code didn't do&lt;/a&gt;. The product changed shape, from one subscription to a pass and packs, and the code around payments kept assuming the old shape. The recovery email didn't break. It quietly kept doing exactly what it was written for, for a product that no longer existed.&lt;/p&gt;

</description>
      <category>rails</category>
      <category>saas</category>
      <category>stripe</category>
      <category>startup</category>
    </item>
  </channel>
</rss>
