<?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: Luca</title>
    <description>The latest articles on DEV Community by Luca (@luca151).</description>
    <link>https://dev.to/luca151</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%2F3648588%2F4df03975-a492-483b-bc01-0abd0b7f16e1.png</url>
      <title>DEV Community: Luca</title>
      <link>https://dev.to/luca151</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luca151"/>
    <language>en</language>
    <item>
      <title>I'm building a dream-reading app with Expo, in public: here's the whole stack</title>
      <dc:creator>Luca</dc:creator>
      <pubDate>Thu, 26 Nov 2026 17:00:00 +0000</pubDate>
      <link>https://dev.to/luca151/im-building-a-dream-reading-app-with-expo-in-public-heres-the-whole-stack-3im6</link>
      <guid>https://dev.to/luca151/im-building-a-dream-reading-app-with-expo-in-public-heres-the-whole-stack-3im6</guid>
      <description>&lt;p&gt;You wake up, half a dream still in your head, and by the time you've made coffee it's gone. I'm building an app for that moment: you tell it the dream (typed or spoken), and it reads it the way an ancient Egyptian scribe might have, with a modern interpretation next to it and a real hieroglyph to remember it by.&lt;/p&gt;

&lt;p&gt;The app is called &lt;strong&gt;Resut&lt;/strong&gt;, from &lt;em&gt;rswt&lt;/em&gt;, the Egyptian word for "dream". I'm building it alone, and I'm going to write about it here as I go: the decisions, the bugs, the tests, the money side. This first post is the map. Every later post goes deep on one piece.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the app does
&lt;/h2&gt;

&lt;p&gt;The core loop is small:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Oracle&lt;/strong&gt; tab: describe last night's dream, or hold the mic and say it.&lt;/li&gt;
&lt;li&gt;A server asks an LLM for two readings: &lt;em&gt;The Modern Scribe&lt;/em&gt;, a grounded psychological take, and &lt;em&gt;The Ancient Omen&lt;/em&gt;, written like a line from a papyrus. It also picks a hieroglyph for the dream from a fixed list of real signs.&lt;/li&gt;
&lt;li&gt;The reading is saved automatically to the &lt;strong&gt;Temple Wall&lt;/strong&gt;, a wall of glyphs with your dreams below it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Around that: an &lt;strong&gt;Incubation&lt;/strong&gt; tab (ask the night a question before sleeping, with ambient sound), and a &lt;strong&gt;Dream Book&lt;/strong&gt; for subscribers, based on a real ancient Egyptian dream papyrus.&lt;/p&gt;

&lt;p&gt;The business model is simple and strict: 2 free readings, ever, then a paywall ("Pharaoh": yearly, monthly, or a one-time Forever purchase), with a 7-day trial on the yearly plan only. Free readings get the Modern Scribe; the Ancient Omen stays sealed until you're Pharaoh. An account is optional and only exists to keep your dreams across devices.&lt;/p&gt;

&lt;p&gt;It isn't in the stores yet. Google Play is being prepared, the App Store comes after.&lt;/p&gt;

&lt;h2&gt;
  
  
  The client: Expo SDK 58, plain JavaScript
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"expo"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"~58.0.26"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nl"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"19.3.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nl"&gt;"react-native"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"0.88.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nl"&gt;"@react-navigation/bottom-tabs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"^7.21.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nl"&gt;"@react-navigation/native-stack"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"^7.21.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nl"&gt;"@supabase/supabase-js"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"^2.119.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nl"&gt;"react-native-purchases"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"^11.0.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few choices that surprise people:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Plain JavaScript.&lt;/strong&gt; No &lt;code&gt;.tsx&lt;/code&gt;. I still run &lt;code&gt;tsc --noEmit&lt;/code&gt; with &lt;code&gt;strict: true&lt;/code&gt; over the JS (JSDoc types where they matter), which catches a surprising amount without the ceremony.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React Navigation, not Expo Router.&lt;/strong&gt; The app is four tabs plus two screens pushed on top. React Navigation was already there from the first prototype and has never been in the way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three typefaces and one hieroglyph font&lt;/strong&gt;, loaded with &lt;code&gt;useFonts&lt;/code&gt; from the &lt;code&gt;@expo-google-fonts&lt;/code&gt; packages: Cinzel for titles, Cormorant Garamond for the readings, Inter for the interface, and Noto Sans Egyptian Hieroglyphs for the signs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;App.js&lt;/code&gt; is mostly a provider tree. The order matters: the theme comes first so even the loading screen is the right colour, then auth, then app state, then the soft prompts (reminder, email).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;ThemeProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;ThemedApp&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;ThemeProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// inside ThemedApp, once fonts and the Appearance setting are ready:&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;SafeAreaProvider&lt;/span&gt; &lt;span class="n"&gt;style&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;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bg&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;AuthProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;AppProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;PromptsProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;StatusBar&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;scheme&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'dark'&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'light'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'dark'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;Root&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;PromptsProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;AppProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;AuthProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;SafeAreaProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Until the fonts load, the app renders a plain view in the background colour of the current mode, so there's never a white flash before a dark screen. If the fonts fail, it carries on with system fonts rather than blocking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigation: tabs, and a reading pushed on top
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Navigator&lt;/span&gt; &lt;span class="n"&gt;screenOptions&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;headerShown&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;contentStyle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bg&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Screen&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Main"&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Tabs&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Screen&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Revelation"&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;RevelationScreen&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;options&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;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'The Revelation'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Screen&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Sanctum"&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;SanctumScreen&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;options&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;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'The Sanctum'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;​&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Navigator&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Main&lt;/code&gt; holds the four tabs (Oracle, Temple Wall, Incubation, Pharaoh). The reading itself, The Revelation, is pushed over them when the Oracle has spoken. Settings (The Sanctum) are a stack card too, not a native modal, for a reason I learned the hard way: the paywall and the bottom sheets are React Native &lt;code&gt;&amp;lt;​Modal&amp;gt;&lt;/code&gt;s mounted at the root, and on iOS a root modal can't be presented over a natively presented screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  The server: one Supabase Edge Function
&lt;/h2&gt;

&lt;p&gt;All the sensitive work happens in a single Supabase Edge Function called &lt;code&gt;oracle&lt;/code&gt;. One URL, &lt;code&gt;POST&lt;/code&gt; only, and an &lt;code&gt;action&lt;/code&gt; field picks what to do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s1"&gt;'status'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seeker&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s1"&gt;'interpret'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;interpret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seeker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dream&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s1"&gt;'omen'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;revealOmen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seeker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;readingId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s1"&gt;'transcribe'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;transcribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seeker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mimeType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// ...track, subscribe_email, register_push, link_device,&lt;/span&gt;
  &lt;span class="c1"&gt;// delete_my_data, delete_account&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function holds the OpenAI key, checks the subscription with RevenueCat's REST API, counts free readings in Postgres and decides whether the Ancient Omen is sent or kept sealed. The app never sees a secret.&lt;/p&gt;

&lt;p&gt;Postgres has grown through five migrations so far: readings, transcriptions, funnel events / email sign-ups / push tokens, accounts and saved dreams, and a quota key that makes free readings survive a reinstall. Tables only the function touches have row level security on and every grant revoked from &lt;code&gt;anon&lt;/code&gt; and &lt;code&gt;authenticated&lt;/code&gt;; the one table the app talks to directly (saved dreams of signed-in users) has policies that limit each user to their own rows.&lt;/p&gt;

&lt;p&gt;Accounts use Supabase Auth: Sign in with Apple, Google through Supabase's browser OAuth, and a 6-digit email code. Optional, never required to read a dream.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI: OpenAI, only on the server
&lt;/h2&gt;

&lt;p&gt;Readings use &lt;code&gt;gpt-4o-mini&lt;/code&gt; by default, set by an environment variable so I can try other models without shipping an app update. Voice uses &lt;code&gt;gpt-4o-mini-transcribe&lt;/code&gt;. The model answers in JSON with three keys, and the server validates every one before anything reaches the phone. Dream text is never logged and never stored by the function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Money: RevenueCat
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;react-native-purchases&lt;/code&gt; handles the stores. Every product (monthly, yearly, lifetime) unlocks one entitlement, &lt;code&gt;pharaoh_pass&lt;/code&gt;. The app reads it to update the UI, but the decision that matters (send the Omen or not, allow another reading or not) is made on the server, which asks RevenueCat itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shipping: EAS Build and EAS Update
&lt;/h2&gt;

&lt;p&gt;Three build profiles in &lt;code&gt;eas.json&lt;/code&gt;: &lt;code&gt;development&lt;/code&gt; (dev client, internal APK), &lt;code&gt;preview&lt;/code&gt; (internal APK) and &lt;code&gt;production&lt;/code&gt; (app bundle, auto-incremented version code). The two internal profiles build for &lt;code&gt;arm64-v8a&lt;/code&gt; only, which keeps the APKs small and the builds faster, since every phone I test on is arm64.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"runtimeVersion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"policy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"fingerprint"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each profile has its own update channel, and the runtime version comes from a fingerprint of the native project, so a JavaScript-only change (new copy, a new sound, a screen tweak) can reach phones through EAS Update without a store build, and a change that touches native code can't be pushed to a binary that doesn't have it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tests: just &lt;code&gt;node --test&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON --test test/*.test.mjs"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No Jest, no extra test dependencies. The logic that matters (sync rules, the hieroglyph vocabulary, the palettes and their contrast ratios, the Dream Book's content rules) lives in plain modules with no React Native import, so Node can run it directly. Right now that's 118 tests in about ten seconds on my machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I'm building it
&lt;/h2&gt;

&lt;p&gt;Most of the code is written by an AI coding agent from task prompts I write in detail: where things stand, what to build, what's out of scope, a definition of done. I review, test on a real Android phone, and push. The prompts live in the repo, and I'll show some of them later in the series.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's coming
&lt;/h2&gt;

&lt;p&gt;The next posts, roughly in order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;moving the OpenAI call off the phone and into the Edge Function;&lt;/li&gt;
&lt;li&gt;getting JSON you can trust out of an LLM;&lt;/li&gt;
&lt;li&gt;voice input with &lt;code&gt;expo-audio&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;rendering real hieroglyphs, and keeping one vocabulary in sync between app and server;&lt;/li&gt;
&lt;li&gt;testing an Expo app with nothing but Node;&lt;/li&gt;
&lt;li&gt;light and dark mode built on tokens;&lt;/li&gt;
&lt;li&gt;how I write prompts for the coding agent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then, in the new year: accounts and offline-first sync, the paywall and the trial, sound, motion, and shipping.&lt;/p&gt;

&lt;p&gt;If there's a part of this stack you want me to go deeper on, tell me in the comments.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Resut is the dream app I'm building in public.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>expo</category>
      <category>supabase</category>
      <category>javascript</category>
    </item>
    <item>
      <title>robots.txt rules that hand-rolled parsers get wrong (tested against a small evaluator)</title>
      <dc:creator>Luca</dc:creator>
      <pubDate>Thu, 26 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/luca151/robotstxt-rules-that-hand-rolled-parsers-get-wrong-tested-against-a-small-evaluator-1ec9</link>
      <guid>https://dev.to/luca151/robotstxt-rules-that-hand-rolled-parsers-get-wrong-tested-against-a-small-evaluator-1ec9</guid>
      <description>&lt;p&gt;I build &lt;a href="https://indexcyborg.com/" rel="noopener noreferrer"&gt;IndexCyborg&lt;/a&gt;, a tool that watches whether a website's pages get indexed. Before it tells anyone "Google hasn't indexed this page", it checks whether the site's own robots.txt blocks it. That meant writing a robots.txt evaluator, and the format turned out to have more rules than its five keywords suggest.&lt;/p&gt;

&lt;p&gt;Below are the ones that surprised us, each with a small example. Every verdict in this post comes from running the examples through our evaluator, about 100 lines of TypeScript written to follow Google's documented behaviour (which builds on RFC 9309).&lt;/p&gt;

&lt;h2&gt;
  
  
  1. A crawler obeys one group, not all of them
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User-agent: *
Disallow: /private/

User-agent: Googlebot
Disallow: /drafts/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Can Googlebot fetch &lt;code&gt;/private/report&lt;/code&gt;? Yes. Google picks the single group with the most specific user agent that matches the crawler. Here that's the &lt;code&gt;Googlebot&lt;/code&gt; group, and the &lt;code&gt;*&lt;/code&gt; group is ignored entirely for Googlebot. Bingbot, which has no group of its own, is blocked from &lt;code&gt;/private/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's an easy mistake to make: you add a crawler-specific group "to add one rule" and silently drop every rule in &lt;code&gt;*&lt;/code&gt; for that crawler. If you want both, repeat the shared rules in the specific group.&lt;/p&gt;

&lt;p&gt;The selection in code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;selectGroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;RobotsRules&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;agentLc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;agents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s2"&gt;"*"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;agentLc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;groups&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;agents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details hide in there. A crawler with no group of its own falls back to a less specific one: with only a &lt;code&gt;googlebot&lt;/code&gt; group, &lt;code&gt;googlebot-image&lt;/code&gt; uses it. And the &lt;code&gt;.filter(...).flatMap(...)&lt;/code&gt; at the end is the next rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Groups for the same crawler are merged
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User-agent: googlebot
Disallow: /a/

User-agent: bingbot
User-agent: googlebot
Disallow: /b/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Googlebot is blocked from both &lt;code&gt;/a/&lt;/code&gt; and &lt;code&gt;/b/&lt;/code&gt;. Google combines every group that names the selected agent into one. Bingbot is blocked only from &lt;code&gt;/b/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The second group also shows that consecutive &lt;code&gt;User-agent&lt;/code&gt; lines share the rules that follow them. A parser has to remember whether the previous line was a &lt;code&gt;User-agent&lt;/code&gt; line to know if a new one starts a new group:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;lastWasAgent&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;agents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;agents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;lastWasAgent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;lastWasAgent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. The longest match wins, not the first one
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User-agent: *
Disallow: /shop/
Allow: /shop/sale/
Disallow: /shop/sale/old
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Verdict&lt;/th&gt;
&lt;th&gt;Winning rule&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/shop/boots&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;blocked&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Disallow: /shop/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/shop/sale/new&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;allowed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Allow: /shop/sale/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/shop/sale/old-boots&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;blocked&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Disallow: /shop/sale/old&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Order in the file doesn't matter. The rule with the longest path that matches wins, so you can carve exceptions out of exceptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. A tie goes to Allow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User-agent: *
Disallow: /page
Allow: /page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;/page&lt;/code&gt; is allowed. When two matching rules are equally long, Google uses the least restrictive one. The evaluation loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;RobotsRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rule&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;matchLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rule&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="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;best&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;allow&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;best&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;allow&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;best&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;allowed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;allow&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;agent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rule&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No matching rule means allowed. No applicable group at all also means allowed.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;code&gt;*&lt;/code&gt; and &lt;code&gt;$&lt;/code&gt;, and the query string is part of the path
&lt;/h2&gt;

&lt;p&gt;Rules match from the start of the path. &lt;code&gt;*&lt;/code&gt; matches any run of characters, and &lt;code&gt;$&lt;/code&gt; anchors the end:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User-agent: *
Disallow: /*.pdf$
Disallow: /*?sessionid=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Verdict&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/docs/a.pdf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;blocked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/docs/a.pdf?x=1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;allowed: &lt;code&gt;$&lt;/code&gt; needs the path to end in &lt;code&gt;.pdf&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/docs/a.PDF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;allowed: paths are case-sensitive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/cart?sessionid=1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;blocked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/cart?a=1&amp;amp;sessionid=2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;allowed: the rule looks for &lt;code&gt;?sessionid=&lt;/code&gt;, not &lt;code&gt;&amp;amp;sessionid=&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That last row bites people who block tracking parameters: parameter order matters. You'd need a second rule for &lt;code&gt;/*&amp;amp;sessionid=&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Our matcher turns the pattern into an anchored regular expression and uses the pattern's length as its specificity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;matchLength&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="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;regex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&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;regex&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;".*"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&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;regex&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;"$"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;regex&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&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="o"&gt;+?^&lt;/span&gt;&lt;span class="nv"&gt;${}&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="p"&gt;[&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;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"\\$&amp;amp;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;RegExp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`^${regex}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&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="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&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="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Callers have to pass the path plus the query string (&lt;code&gt;url.pathname + url.search&lt;/code&gt;), not just &lt;code&gt;URL.pathname&lt;/code&gt;, or the second rule above can never match. One of our own callers, the background job that checks each page, passed &lt;code&gt;pathname&lt;/code&gt; alone. Writing this post is how we found it.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Things that look like rules but aren't
&lt;/h2&gt;

&lt;p&gt;Our tester flags these, because Googlebot ignores them without a word:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Disallow: /everything
User-agent: *
Crawl-delay: 10
Noindex: /old/
Disallow:
Sitemap: /sitemap.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Line 1:&lt;/strong&gt; a rule before any &lt;code&gt;User-agent&lt;/code&gt; line belongs to no group. &lt;code&gt;/everything&lt;/code&gt; stays crawlable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Crawl-delay&lt;/code&gt;&lt;/strong&gt; isn't supported by Google (other crawlers do read it).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Noindex&lt;/code&gt;&lt;/strong&gt; in robots.txt isn't supported by Google either. Use a &lt;code&gt;noindex&lt;/code&gt; meta tag or an &lt;code&gt;X-Robots-Tag&lt;/code&gt; header.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Disallow:&lt;/code&gt;&lt;/strong&gt; with an empty value allows everything. We store it as &lt;code&gt;Allow: /&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Sitemap&lt;/code&gt;&lt;/strong&gt; must be a fully qualified URL with protocol and host. A relative path is an error. Sitemap lines also don't belong to any group: they apply no matter where they appear.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Field names are case-insensitive (&lt;code&gt;user-agent&lt;/code&gt;, &lt;code&gt;USER-AGENT&lt;/code&gt;); path values are not (&lt;code&gt;/Admin/&lt;/code&gt; doesn't block &lt;code&gt;/admin/&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Size and status codes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Google reads the first 500 KiB of a robots.txt file and ignores the rest.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;4xx&lt;/code&gt; answer (except &lt;code&gt;429&lt;/code&gt;) is treated as "no robots.txt": everything is allowed.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;5xx&lt;/code&gt; answer is not. Google stops crawling the site for 12 hours while it retries, then uses the last cached copy for up to 30 days.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A confession: our checker treats any non-200 answer as "no rules", which matches Google for 4xx only. That's an acceptable shortcut for a checker that explains a page's status. It isn't acceptable for a crawler, which should back off on 5xx.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Blocked isn't the same as not indexed
&lt;/h2&gt;

&lt;p&gt;The last surprise isn't about parsing. A page blocked by robots.txt can still show up in Google if other pages link to it: Google indexes the URL without its content. And a blocked page can't tell Google &lt;code&gt;noindex&lt;/code&gt;, because Google never fetches it to read the tag.&lt;/p&gt;

&lt;p&gt;So "allowed by robots.txt" is the first question to answer when a page isn't indexed, not the whole answer. If you want a page out of the index, allow crawling and serve &lt;code&gt;noindex&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Check which group each crawler you care about actually uses. A specific group replaces &lt;code&gt;*&lt;/code&gt;, it doesn't extend it.&lt;/li&gt;
&lt;li&gt;Expect merged groups and shared &lt;code&gt;User-agent&lt;/code&gt; lines.&lt;/li&gt;
&lt;li&gt;Longest match wins; ties go to Allow.&lt;/li&gt;
&lt;li&gt;Match against path plus query, case-sensitively.&lt;/li&gt;
&lt;li&gt;Lint for rules Google ignores: &lt;code&gt;Crawl-delay&lt;/code&gt;, &lt;code&gt;Noindex&lt;/code&gt;, rules before the first &lt;code&gt;User-agent&lt;/code&gt;, relative &lt;code&gt;Sitemap&lt;/code&gt; URLs.&lt;/li&gt;
&lt;li&gt;Keep the file under 500 KiB, and make sure it never answers &lt;code&gt;5xx&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;I wrote this with the help of an AI assistant, working from the project's commits and code. The snippets come from the repository, trimmed for length, and every verdict in the tables was produced by running that code.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>seo</category>
      <category>webdev</category>
      <category>typescript</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I'm building a Pinterest pin generator as a solo dev: the stack and why</title>
      <dc:creator>Luca</dc:creator>
      <pubDate>Wed, 25 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/luca151/im-building-a-pinterest-pin-generator-as-a-solo-dev-the-stack-and-why-d8</link>
      <guid>https://dev.to/luca151/im-building-a-pinterest-pin-generator-as-a-solo-dev-the-stack-and-why-d8</guid>
      <description>&lt;p&gt;Every blog post I publish gets one image for social media, and Pinterest wants something else entirely: a tall 2:3 image with big words on it, several different ones per post, posted a few days apart. So I'm building a tool that reads a blog post and turns it into ready-to-post pins, and this is the stack I picked, piece by piece, with the reasons.&lt;/p&gt;

&lt;p&gt;It's a solo project. The first commit landed on 15 November 2026 and the app has been live since that evening. Here's what it runs on, and what I'd do the same way again.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the app does, in one paragraph
&lt;/h2&gt;

&lt;p&gt;You paste a link (or describe a product that has no website yet). The server reads the page, an LLM writes a few headline angles plus a Pinterest title, description and keywords, and the server draws several 1000×1500 pin designs. You approve them one by one, then schedule them to Pinterest or download a ZIP with a CSV for Pinterest's bulk upload.&lt;/p&gt;

&lt;p&gt;That gives four hard parts: reading pages, writing copy, drawing images, and posting on a schedule. Everything else is a normal web app.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape of it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Next.js 16 (App Router, route handlers)  ── on Vercel, region dub1
   │
   ├─ Cheerio ............ reads the blog post
   ├─ Anthropic SDK ...... headlines, title, description, keywords
   ├─ Satori + sharp ..... draws the pins (JSX → SVG → PNG → JPEG)
   ├─ fal.ai / Gemini .... optional AI photos behind the headline
   ├─ Drizzle ORM ........ one schema, two drivers:
   │     ├─ PGlite (embedded Postgres) on my machine and in tests
   │     └─ Supabase Postgres in production
   ├─ Supabase Auth ...... accounts and auth emails
   ├─ Stripe ............. Checkout, customer portal, webhook
   └─ Pinterest API v5 ... boards and pin creation
pg_cron (in Supabase) ── calls /api/cron/publish every 5 minutes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Next.js 16 on Vercel, pinned to one region
&lt;/h2&gt;

&lt;p&gt;I wanted one deployable thing: pages, API routes, image rendering and the cron endpoint in the same codebase. Next.js route handlers do that, and Vercel deploys every push to &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The one setting I'd tell anyone to look at is the region. My database is in Ireland (eu-west-1), and a page that makes a dozen queries pays the round trip a dozen times. So the functions run in Dublin, next to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://openapi.vercel.sh/vercel.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"regions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"dub1"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I did take a detour first. The very first deployment ran in a container on Cloudflare, built and smoke-tested in GitHub Actions. It needed an API token I didn't have set up, Vercel needed nothing, and two days later I deleted the Dockerfile, the Worker and the workflow. Lesson: pick the host that removes steps, not the one that's most interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Postgres everywhere, but not the same Postgres
&lt;/h2&gt;

&lt;p&gt;In production it's Supabase Postgres, in its own schema, reached by a role that owns that schema and nothing else, through the transaction pooler (port 6543), because serverless functions open lots of short connections.&lt;/p&gt;

&lt;p&gt;On my machine there's no Postgres server at all. &lt;a href="https://pglite.dev" rel="noopener noreferrer"&gt;PGlite&lt;/a&gt; runs real Postgres compiled to WebAssembly inside the Node process, and stores its data in a folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Local data folder (embedded database, image cache). Serverless hosts only&lt;/span&gt;
&lt;span class="c1"&gt;// allow writing to the temp directory.&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;DATA_DIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DATA_DIR&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;VERCEL&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tmpdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"your-app"&lt;/span&gt;&lt;span class="p"&gt;)&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="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cwd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".data"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With no &lt;code&gt;DATABASE_URL&lt;/code&gt; the app opens PGlite, with one it opens &lt;code&gt;pg&lt;/code&gt;. Drizzle sits on top of both, so queries are written once. The test suite gets a fresh embedded database per run in a temp folder, which means &lt;code&gt;pnpm test&lt;/code&gt; needs no Docker and no network.&lt;/p&gt;

&lt;p&gt;One quirk worth knowing: an embedded database can only be opened by one process. If you want to run a second copy of the app next to a running dev server, point it at another folder with &lt;code&gt;DATA_DIR&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Satori for the images
&lt;/h2&gt;

&lt;p&gt;Pins are the product, so image rendering got the most thought. The options were a headless browser (heavy on serverless), a canvas library (you draw everything by hand), or &lt;a href="https://github.com/vercel/satori" rel="noopener noreferrer"&gt;Satori&lt;/a&gt;, which turns JSX with a subset of CSS into SVG. Next.js ships it as &lt;code&gt;ImageResponse&lt;/code&gt; in &lt;code&gt;next/og&lt;/code&gt;, and &lt;code&gt;sharp&lt;/code&gt; turns the result into a JPEG.&lt;/p&gt;

&lt;p&gt;Satori is fast and runs anywhere Node runs, but it's not a browser: flexbox only, no text wrapping you can control, no automatic font sizing. I wrote a small layout layer that measures every headline with the real glyph widths from the font files. That's two articles of its own later in this series.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI where it earns its place, and the app works without it
&lt;/h2&gt;

&lt;p&gt;Copy comes from Claude through the official Anthropic SDK. Optional AI images come from fal.ai and from Google directly, depending on the model, because I buy each model where it's cheapest.&lt;/p&gt;

&lt;p&gt;The rule I set early: the app must run with zero API keys. Without an Anthropic key the copy comes from the page's own title, description and headings. Without image keys the pins use the page's own photos. Each integration is switched on by its key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;features&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;aiCopy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;aiImages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;FAL_KEY&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;GEMINI_API_KEY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;pinterest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PINTEREST_CLIENT_ID&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PINTEREST_CLIENT_SECRET&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;stockPhotos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PIXABAY_API_KEY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This paid off immediately. I could build and test the whole flow before any account existed, and a missing key degrades a feature instead of breaking the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scheduling without a long-running server
&lt;/h2&gt;

&lt;p&gt;Pins are scheduled for specific times, so something has to wake up regularly and publish what's due. On a normal server that's a &lt;code&gt;setInterval&lt;/code&gt;, and locally that's exactly what runs. On Vercel's free plan, cron jobs run once a day, which is useless for posting at 10:40.&lt;/p&gt;

&lt;p&gt;The fix was already in my database: Supabase has &lt;code&gt;pg_cron&lt;/code&gt; and &lt;code&gt;pg_net&lt;/code&gt;, so a job inside Postgres calls &lt;code&gt;/api/cron/publish&lt;/code&gt; every five minutes with a bearer secret. I'll cover the setup in an upcoming post, and another one on the afternoon it broke after a domain change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Auth and payments: don't build them
&lt;/h2&gt;

&lt;p&gt;I started with homemade email and password auth with httpOnly session cookies, and moved to Supabase Auth on day two. Email confirmation, password reset and email change are exactly the kind of code where I'd rather not be the only reviewer. The app keeps its own &lt;code&gt;users&lt;/code&gt; row (plan, credits, Pinterest connection) linked to the Supabase user.&lt;/p&gt;

&lt;p&gt;Payments are Stripe Checkout plus the customer portal plus one webhook that moves an account between plans. I don't render a single card field.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule the platform imposes
&lt;/h2&gt;

&lt;p&gt;One design decision isn't technical. Pinterest's developer guidelines require that the end user choose each pin that gets published. So every pin starts as a draft, only approved pins can be scheduled, and there is no "approve all and autopost" path anywhere, including for the AI assistants that can drive the app over MCP. Read the platform's rules before you design the flow, not after.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it stands, honestly
&lt;/h2&gt;

&lt;p&gt;As I write this (23 November 2026):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The app is live, with sign-up, page reading, pin rendering, AI copy and AI images working on the real site.&lt;/li&gt;
&lt;li&gt;Nobody has paid yet. Stripe Checkout opens with the right prices, but no real payment has gone through.&lt;/li&gt;
&lt;li&gt;My Pinterest developer app is still waiting for approval. Direct posting has only been tested against a fake Pinterest API that I run in tests. Until then, ZIP plus CSV export is the way out.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Put your functions in the same region as your database. It's one line of config.&lt;/li&gt;
&lt;li&gt;An embedded Postgres (PGlite) for local work and tests removes Docker from the dev loop without changing your SQL.&lt;/li&gt;
&lt;li&gt;Make every third-party integration optional, switched on by its key. You can build before the accounts exist.&lt;/li&gt;
&lt;li&gt;Don't build auth or payments if a provider does it well.&lt;/li&gt;
&lt;li&gt;Read the platform's developer rules before you design the core flow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The product is PinCyborg (&lt;a href="http://www.pincyborg.com" rel="noopener noreferrer"&gt;www.pincyborg.com&lt;/a&gt;); this series follows how it's built.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with help from an AI assistant and checked against the real code.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>buildinpublic</category>
      <category>nextjs</category>
      <category>saas</category>
    </item>
    <item>
      <title>One line blanked our whole React app: Vite manualChunks and the temporal dead zone</title>
      <dc:creator>Luca</dc:creator>
      <pubDate>Tue, 24 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/luca151/one-line-blanked-our-whole-react-app-vite-manualchunks-and-the-temporal-dead-zone-46b7</link>
      <guid>https://dev.to/luca151/one-line-blanked-our-whole-react-app-vite-manualchunks-and-the-temporal-dead-zone-46b7</guid>
      <description>&lt;p&gt;I build &lt;a href="https://candidatefalcon.com/" rel="noopener noreferrer"&gt;Candidate Falcon&lt;/a&gt;, a practice site for hiring assessments and one-way video interviews. At the start of November a release that added two new interview types reached production, and every page went blank. The login form didn't render, no button worked, and the console showed one error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ReferenceError: Cannot access 'ko' before initialization
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It stayed broken for about 11 hours, partly because our deploy checks said everything was fine. This post is about why one innocent-looking line caused it, and the two checks we added so it can't happen quietly again.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup: manual chunks
&lt;/h2&gt;

&lt;p&gt;The app is built with Vite, and the Rollup output uses &lt;code&gt;manualChunks&lt;/code&gt; to split the bundle by area of the site:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;manualChunks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;normalizedId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;\\&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;normalizedId&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/node_modules/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;'vendor'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;includesAny&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;normalizedId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;ONE_WAY_CHUNK_MATCHERS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;'one-way'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;includesAny&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;normalizedId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;TIPS_CHUNK_MATCHERS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;'tips'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;includesAny&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;normalizedId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;HOME_CHUNK_MATCHERS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;'home'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything under &lt;code&gt;src/pages/prep/video-interviews/&lt;/code&gt; goes into a chunk called &lt;code&gt;one-way&lt;/code&gt;. Code in that folder imports shared modules that stay in the main chunk, such as &lt;code&gt;@/lib/videoProviders&lt;/code&gt;. And the main chunk imports the &lt;code&gt;one-way&lt;/code&gt; chunk. So the two chunks import each other.&lt;/p&gt;

&lt;p&gt;That cycle doesn't exist in the source. &lt;code&gt;videoProviders.ts&lt;/code&gt; imports nothing from the video-interview folder. The cycle only appears once Rollup groups modules into chunks: chunk A holds modules that need chunk B, and chunk B holds modules that need chunk A.&lt;/p&gt;

&lt;h2&gt;
  
  
  The line that broke it
&lt;/h2&gt;

&lt;p&gt;A file inside the video-interview folder kept its own hard-coded list of valid providers. The release added two providers, so it replaced the copy with the shared constant, to have one source of truth:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gi"&gt;+import { VIDEO_PROVIDER_IDS } from "@/lib/videoProviders";&lt;/span&gt;

&lt;span class="gd"&gt;-const VALID_PROVIDERS: OneWayProvider[] = ["hirevue", "sparkhire", "vidcruiter", "talview"];&lt;/span&gt;
&lt;span class="gi"&gt;+const VALID_PROVIDERS: readonly OneWayProvider[] = VIDEO_PROVIDER_IDS;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It looks like a textbook cleanup.&lt;/p&gt;

&lt;p&gt;Here's what happens when the browser loads the bundle. ES modules in a cycle are evaluated in a fixed order. When the main chunk starts, it first evaluates the chunks it imports, including &lt;code&gt;one-way&lt;/code&gt;. &lt;code&gt;one-way&lt;/code&gt; imports from the main chunk, but the main chunk is already in progress, so the browser doesn't wait for it and runs the body of &lt;code&gt;one-way&lt;/code&gt; straight away. That body now contains &lt;code&gt;const VALID_PROVIDERS = VIDEO_PROVIDER_IDS&lt;/code&gt;, and &lt;code&gt;VIDEO_PROVIDER_IDS&lt;/code&gt; is a &lt;code&gt;const&lt;/code&gt; in the main chunk whose declaration hasn't run yet.&lt;/p&gt;

&lt;p&gt;Reading a &lt;code&gt;let&lt;/code&gt; or &lt;code&gt;const&lt;/code&gt; binding before its declaration has run throws a &lt;code&gt;ReferenceError&lt;/code&gt;: the binding is in its temporal dead zone. &lt;code&gt;ko&lt;/code&gt; is simply what the minifier called &lt;code&gt;VIDEO_PROVIDER_IDS&lt;/code&gt;. The error was thrown while the bundle was first being evaluated, so the main chunk never finished, and nothing after it ran, including React rendering the app.&lt;/p&gt;

&lt;p&gt;The hard-coded array had no imports, so it was always safe. Reading the shared constant inside a function would have been safe too: by the time any function runs, both chunks have finished evaluating. The bug wasn't importing the value. It was reading it while the module was still loading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why nothing caught it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The dev server doesn't build chunks.&lt;/strong&gt; Vite serves each module separately in development, so there's no chunk cycle and the modules load in their natural order. The bug only exists in the production bundle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unit tests import modules directly&lt;/strong&gt;, so the same is true there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Our deploy check used &lt;code&gt;curl&lt;/code&gt;.&lt;/strong&gt; Our pages are prerendered, so every URL returned 200 with the right title and content. The HTML was fine. The JavaScript that makes it interactive crashed on load.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Read the value when it's needed, not when the module loads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Read VIDEO_PROVIDER_IDS when called, never into a module-level constant: this file is in the 'one-way' chunk&lt;/span&gt;
&lt;span class="c1"&gt;// and @/lib/videoProviders in the main one, which import each other, so a top-level read runs before the main&lt;/span&gt;
&lt;span class="c1"&gt;// chunk has set the value.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;isValidProvider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="nc"&gt;OneWayProvider&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;VIDEO_PROVIDER_IDS&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;isValidProvider&lt;/code&gt; is defined at module level, but it only touches &lt;code&gt;VIDEO_PROVIDER_IDS&lt;/code&gt; when it's called.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guard 1: a test for the pattern
&lt;/h2&gt;

&lt;p&gt;Testing chunk evaluation order in Vitest isn't practical, but we can ban the pattern that triggers it. This test walks the folder that becomes the &lt;code&gt;one-way&lt;/code&gt; chunk, collects the names each file imports from outside it, and fails if any of them is copied into a module-level constant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'..'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'src'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'pages'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'prep'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'video-interviews'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/** Names imported as values from modules outside the video-interviews folder. */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;outsideImports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matchAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;\&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;^&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="p"&gt;)&lt;/span&gt;\&lt;span class="p"&gt;}&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"'](@\/(?!pages\/prep\/video-interviews)[^"&lt;/span&gt;&lt;span class="s1"&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;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;names&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="s1"&gt;','&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&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;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'type '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&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="o"&gt;/&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;\&lt;span class="n"&gt;s&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="nf"&gt;pop&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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'never copies a value imported from outside the chunk into a module-level constant'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;offenders&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&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="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'utf8'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nf"&gt;outsideImports&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;RegExp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`^(?:export\\s+)?const\\s+\\w+(?::[^=]+)?\\s*=\\s*${name}\\s*;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'m'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;offenders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${relative(root, file)}: ${name}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;offenders&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's a regex, so it only catches the simple alias case (&lt;code&gt;const X = importedValue;&lt;/code&gt;), not every possible top-level read. It would have caught this one, and it documents the rule right where the next person would trip over it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guard 2: check the real site in a real browser
&lt;/h2&gt;

&lt;p&gt;After every deploy we now open the live site in a browser and read the console on the login page, the homepage and one page that changed. To reproduce chunk problems locally, build for production and serve the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx vite build
npx vite preview
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;vite preview&lt;/code&gt; serves the same chunks as production, which is the only place this kind of bug exists.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;manualChunks&lt;/code&gt; can create import cycles between chunks that don't exist between your modules.&lt;/li&gt;
&lt;li&gt;Inside such a cycle, a module-level read of an imported &lt;code&gt;const&lt;/code&gt; can run before that &lt;code&gt;const&lt;/code&gt; is initialized. Reads inside functions are safe.&lt;/li&gt;
&lt;li&gt;If your HTML is prerendered, a 200 with the right title proves nothing about your JavaScript. Check the console.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;I wrote this with the help of an AI assistant, working from the project's commits and code. The snippets come from the repository, trimmed for length.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>vite</category>
      <category>javascript</category>
      <category>debugging</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Every IndexNow ping from our Cloudflare Worker got 429: shared egress IPs and a relay</title>
      <dc:creator>Luca</dc:creator>
      <pubDate>Thu, 19 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/luca151/every-indexnow-ping-from-our-cloudflare-worker-got-429-shared-egress-ips-and-a-relay-afp</link>
      <guid>https://dev.to/luca151/every-indexnow-ping-from-our-cloudflare-worker-got-429-shared-egress-ips-and-a-relay-afp</guid>
      <description>&lt;p&gt;I build &lt;a href="https://indexcyborg.com/" rel="noopener noreferrer"&gt;IndexCyborg&lt;/a&gt;, a tool that automates the indexing chores of a website: it reads the sitemaps, checks pages, asks Google's URL Inspection API what it knows, and notifies search engines through IndexNow when pages are new or changed. It runs on Cloudflare Workers.&lt;/p&gt;

&lt;p&gt;On November 5 every IndexNow notification sent from production came back &lt;code&gt;429 Too Many Requests&lt;/code&gt;. Not some of them: every one, for hours. The same POST, with the same key and the same URLs, sent from my own PC got &lt;code&gt;202&lt;/code&gt;. Sent from a Supabase Edge Function it got &lt;code&gt;200&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This post is what we tried, what didn't work, and the small relay that fixed it.&lt;/p&gt;

&lt;h2&gt;
  
  
  IndexNow in one paragraph
&lt;/h2&gt;

&lt;p&gt;IndexNow is a protocol that Bing, Yandex, Seznam, Naver and a few other engines share. You host a key file at &lt;code&gt;https://example.com/&amp;lt;key&amp;gt;.txt&lt;/code&gt;, then POST a JSON body to an endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"host"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"your-key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"keyLocation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com/your-key.txt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"urlList"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"https://example.com/new-page"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The participating engines share submissions with each other, so one accepted notification reaches all of them. Google doesn't take part.&lt;/p&gt;

&lt;p&gt;The documented answers are worth knowing by heart:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;200&lt;/code&gt; received, &lt;code&gt;202&lt;/code&gt; received with key validation still pending&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;400&lt;/code&gt; bad format, &lt;code&gt;403&lt;/code&gt; key not valid, &lt;code&gt;422&lt;/code&gt; URLs don't belong to the host or the key doesn't match&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;429&lt;/code&gt; too many requests, "potential spam"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;200&lt;/code&gt; and &lt;code&gt;202&lt;/code&gt; mean the engine received the URLs. They don't mean anything was crawled or indexed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a tiny sender got rate-limited
&lt;/h2&gt;

&lt;p&gt;We were sending a handful of notifications per site per day, so volume wasn't the problem. What changed between "refused" and "accepted" was only where the request came from.&lt;/p&gt;

&lt;p&gt;IndexNow doesn't document how it rate-limits, so this part is an inference: the limit is applied per caller IP, and the egress IPs of a serverless platform are shared with a lot of other customers. Some of them presumably send IndexNow traffic too. From the engine's side, our request was one more POST from a busy address.&lt;/p&gt;

&lt;p&gt;If your serverless function talks to an API that throttles by IP, you inherit the reputation of everyone you share an exit with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt 1: try the next engine
&lt;/h2&gt;

&lt;p&gt;Any participating engine can take the notification, so the first fix was a fallback: if &lt;code&gt;api.indexnow.org&lt;/code&gt; refuses, try &lt;code&gt;www.bing.com/indexnow&lt;/code&gt; with the same body.&lt;/p&gt;

&lt;p&gt;The important detail is which failures move on. A 429, a 5xx or a network error might be different elsewhere. A 403 about the key or a 422 about the host would be the same at every engine, so retrying those just repeats the refusal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;INDEXNOW_ENDPOINTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"https://api.indexnow.org/indexnow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"https://www.bing.com/indexnow"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;isTransientIndexNowFailure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;IndexNowResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statusCode&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// network error&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statusCode&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;429&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statusCode&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It didn't help. Bing answered 429 too, which fits the IP theory: same caller, same verdict.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt 2: stop hammering
&lt;/h2&gt;

&lt;p&gt;Every refused attempt also wrote a "submission failed" row and an activity event, so a single notification could leave a trail of failures in the dashboard. And every retry was one more request to an endpoint that was already saying "too many".&lt;/p&gt;

&lt;p&gt;Now a transient refusal is retried with a delay that grows with the job's age, for six hours, and only the final outcome is recorded:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;RETRY_WINDOW_MS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// 10 minutes at first, then half the job's age, at most an hour.&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;retryDelayMs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jobAgeMs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;jobAgeMs&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;transient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;isTransientIndexNowFailure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;jobAgeMs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&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="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;transient&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;jobAgeMs&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;RETRY_WINDOW_MS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RetryLater&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`IndexNow transient failure: ${result.error}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;retryDelayMs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jobAgeMs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the window runs out, or when the refusal is permanent, the job throws a &lt;code&gt;PermanentFailure&lt;/code&gt; instead of finishing quietly. A notification job that reads "completed" should mean an engine accepted it.&lt;/p&gt;

&lt;p&gt;That made the failures honest. It didn't make them succeed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: send it from somewhere else
&lt;/h2&gt;

&lt;p&gt;Since the refusals followed the IP, the notification had to leave from a different one. We already use Supabase, and a request from a Supabase Edge Function had been accepted, so the relay became an Edge Function: the Worker hands it the notification, it posts to the engines and reports what they answered.&lt;/p&gt;

&lt;p&gt;A relay that posts arbitrary JSON to arbitrary URLs on request would be an open proxy, so it's deliberately narrow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It authenticates callers with a shared secret, and only the hash lives in the source:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sha256Hex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;digest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SHA-256"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextEncoder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&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="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Both sides are fixed-length hex digests; compare without stopping at the first difference.&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sameDigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;|=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function is deployed with Supabase's JWT check turned off, because the caller is our Worker, not a Supabase user. The plaintext secret exists only as a Worker secret.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It rebuilds the notification from the four fields IndexNow takes,&lt;/strong&gt; and refuses URLs that aren't on the notified host (ignoring a leading &lt;code&gt;www.&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;onSite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keyLocation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"keyLocation must be a URL on host"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;urlList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;onSite&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"every URL must be on host"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;keyLocation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urlList&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;urlList&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;It tries both engines and reports every attempt,&lt;/strong&gt; so the Worker can log what happened at the relay, not just the last status code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;endpoint&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="no"&gt;INDEXNOW_ENDPOINTS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fetchImpl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;notification&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;attempts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statusCode&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isTransient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;attempts&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Worker side
&lt;/h2&gt;

&lt;p&gt;The Worker tries the relay first when it's configured, then falls back to posting directly. The order matters: the Worker's own IP is the one being refused, so trying it first only adds refused requests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;relay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;indexNowRelay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// null unless INDEXNOW_RELAY_URL and INDEXNOW_RELAY_SECRET are set&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;relay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;viaRelay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;postViaRelay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;relay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;viaRelay&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isTransientIndexNowFailure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;tried&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;viaRelay&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tried&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="no"&gt;INDEXNOW_ENDPOINTS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;toResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;postIndexNow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isTransientIndexNowFailure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;tried&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${new URL(endpoint).host}: ${last.statusCode ?? "network error"}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One distinction kept debugging sane: "the relay refused me" is not an IndexNow answer. A wrong secret, an undeployed function or a malformed reply is reported as &lt;code&gt;relay unusable&lt;/code&gt;, separately from what the engines said. Without that, a typo in a secret would look like IndexNow rate-limiting us again.&lt;/p&gt;

&lt;p&gt;The submissions table also records which endpoint answered, so "accepted via the relay" and "accepted directly" are visible later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing a Deno function from a Node test suite
&lt;/h2&gt;

&lt;p&gt;Edge Functions run on Deno, the app's tests run on Vitest. The relay's logic lives in a &lt;code&gt;handler.ts&lt;/code&gt; with no Deno APIs (only &lt;code&gt;fetch&lt;/code&gt;, &lt;code&gt;Request&lt;/code&gt;, &lt;code&gt;Response&lt;/code&gt; and Web Crypto), and the Deno entry point is three lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;handleRelay&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"./handler.ts"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;SECRET_SHA256&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;hex sha-256 of the secret&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;Deno&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;serve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;handleRelay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;secretSha256&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;SECRET_SHA256&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The handler takes an optional &lt;code&gt;fetchImpl&lt;/code&gt;, so tests pass a stub and check the secret check, the host filter and the fallback order without touching the network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Did it work?
&lt;/h2&gt;

&lt;p&gt;Yes. The first production notification sent through the relay was accepted with a &lt;code&gt;200&lt;/code&gt;, after a day in which nothing had got through.&lt;/p&gt;

&lt;p&gt;It's not free of trade-offs. It's another moving part with its own secret to rotate. Supabase's egress is shared too, so nothing guarantees it stays welcome forever. That's why the direct endpoints stay as a fallback and every attempt is recorded. If it starts failing, the logs will say where.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist if you call IndexNow from serverless
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Treat &lt;code&gt;429&lt;/code&gt;, &lt;code&gt;5xx&lt;/code&gt; and network errors as "try elsewhere or later". Treat &lt;code&gt;403&lt;/code&gt; and &lt;code&gt;422&lt;/code&gt; as "fix the key or the URLs".&lt;/li&gt;
&lt;li&gt;Back off for real. Fast retries against a rate limit make it worse.&lt;/li&gt;
&lt;li&gt;Record the final outcome once, not every attempt.&lt;/li&gt;
&lt;li&gt;If refusals follow the platform rather than your volume, send from a different egress: a relay function on another provider, or any machine with its own IP.&lt;/li&gt;
&lt;li&gt;Keep the relay narrow: authenticated, limited to the payload IndexNow takes, limited to your own hosts.&lt;/li&gt;
&lt;li&gt;Don't tell users "indexed" when an engine says &lt;code&gt;202&lt;/code&gt;. It means "received".&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;I wrote this with the help of an AI assistant, working from the project's commits and code. The snippets come from the repository, trimmed for length.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>seo</category>
      <category>serverless</category>
      <category>webdev</category>
      <category>debugging</category>
    </item>
    <item>
      <title>Your React accordion may be hiding answers from Google (and forceMount alone won't fix it)</title>
      <dc:creator>Luca</dc:creator>
      <pubDate>Tue, 17 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/luca151/your-react-accordion-may-be-hiding-answers-from-google-and-forcemount-alone-wont-fix-it-1ne2</link>
      <guid>https://dev.to/luca151/your-react-accordion-may-be-hiding-answers-from-google-and-forcemount-alone-wont-fix-it-1ne2</guid>
      <description>&lt;p&gt;I build &lt;a href="https://candidatefalcon.com/" rel="noopener noreferrer"&gt;Candidate Falcon&lt;/a&gt;, a practice site for people facing hiring assessments and one-way video interviews. It's a React app that we prerender to static HTML at build time, and most of its pages are written for search: guides, FAQs, pricing.&lt;/p&gt;

&lt;p&gt;During an audit of what crawlers actually receive from each page, the FAQ page stood out. It had 22 questions, each with its answer inside a Radix accordion (the shadcn/ui one). In the browser the page looked complete. The prerendered HTML had all 22 questions and none of the 22 answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the answers were missing
&lt;/h2&gt;

&lt;p&gt;Radix only mounts the content of an accordion item while the item is open. A closed &lt;code&gt;AccordionContent&lt;/code&gt; renders nothing: no node, no text. So when the page is rendered on the server, or by a crawler that doesn't click anything, the answers aren't there.&lt;/p&gt;

&lt;p&gt;Two things made this worse than it sounds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The page also emitted &lt;code&gt;FAQPage&lt;/code&gt; JSON-LD with all 22 answers, built from the same data. So the structured data described text that wasn't in the HTML. Google's structured data guidelines ask you not to mark up content that isn't visible to readers of the page. (FAQ rich results are now limited to well-known government and health sites anyway, so this wasn't about rich results. It was about the answers being indexable at all.)&lt;/li&gt;
&lt;li&gt;"Hidden" and "absent" are different things. Google has said for years that content tucked into tabs or accordions for usability still gets indexed, as long as it's in the page. Content that only exists after a click is a different case: there's nothing to index.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The quickest way to check your own pages is to fetch the HTML the server sends and search for a sentence that only appears inside a closed panel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s https://example.com/faq/ &lt;span class="o"&gt;|&lt;/span&gt; grep -c &lt;span class="s2"&gt;"a sentence from inside a closed answer"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it prints &lt;code&gt;0&lt;/code&gt;, the answer isn't in the HTML.&lt;/p&gt;

&lt;h2&gt;
  
  
  The obvious fix: forceMount
&lt;/h2&gt;

&lt;p&gt;Radix has a prop for exactly this. &lt;code&gt;forceMount&lt;/code&gt; keeps the content mounted whether the item is open or closed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AccordionContent&lt;/span&gt; &lt;span class="n"&gt;forceMount&lt;/span&gt; &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;AccordionContent&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After this change the answers were in the HTML. They were also all visible, which wasn't the plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  The catch: with forceMount, you do the hiding
&lt;/h2&gt;

&lt;p&gt;Normally Radix hides a closed panel by giving it the &lt;code&gt;hidden&lt;/code&gt; attribute. With &lt;code&gt;forceMount&lt;/code&gt;, it doesn't. In the collapsible source, the content keeps an internal &lt;code&gt;isPresent&lt;/code&gt; flag that starts from the &lt;code&gt;present&lt;/code&gt; prop, and &lt;code&gt;present&lt;/code&gt; is always true when you force-mount. The &lt;code&gt;hidden&lt;/code&gt; attribute is computed from &lt;code&gt;open || isPresent&lt;/code&gt;, so it's never set.&lt;/p&gt;

&lt;p&gt;Here's one of our closed answers in the built HTML (attributes trimmed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;data-state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"closed"&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"region"&lt;/span&gt; &lt;span class="na"&gt;data-slot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"accordion-content"&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"..."&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;data-state="closed"&lt;/code&gt;, but no &lt;code&gt;hidden&lt;/code&gt;. Without extra CSS, every answer renders expanded, both in the server HTML and after hydration.&lt;/p&gt;

&lt;p&gt;The fix is to hide closed panels yourself, keyed on &lt;code&gt;data-state&lt;/code&gt;. Our first version was a rule scoped to the FAQ page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.faq-page&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;data-slot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"accordion-content"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;data-state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"closed"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Later we moved it into the shared shadcn component, so any page that force-mounts gets it for free:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;AccordionContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;props&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AccordionPrimitive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Content&lt;/span&gt;
      &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;slot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"accordion-content"&lt;/span&gt;
      &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;cn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="c1"&gt;// Force-mounted content stays in the server HTML, so it must hide itself when closed.&lt;/span&gt;
        &lt;span class="n"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forceMount&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="s2"&gt;"data-[state=closed]:hidden"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;props&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;cn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pt-0 pb-4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;AccordionPrimitive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;display: none&lt;/code&gt; keeps the text in the DOM and out of view, which is the "hidden, not absent" state we want. Opening and closing still work, because Radix flips &lt;code&gt;data-state&lt;/code&gt; on click.&lt;/p&gt;

&lt;h2&gt;
  
  
  A test that reads the built HTML
&lt;/h2&gt;

&lt;p&gt;A unit test that renders the component in JSDOM would have passed the whole time: the bug only shows in the prerendered output. So the regression test reads &lt;code&gt;dist/faq/index.html&lt;/code&gt; after the build and checks it against the same data the page uses (trimmed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;faqGroups&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'..'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'dist'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'faq'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'index.html'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'utf8'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;JSDOM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'keeps five groups and 22 ordered answers in the HTML body'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;contents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'main [data-slot="accordion-content"]'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toHaveLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'data-state'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'closed'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;section&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sections&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'paragraph'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textContent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toContain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bullet&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textContent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toContain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bullet&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A second test parses the JSON-LD on the same page and checks that the &lt;code&gt;FAQPage&lt;/code&gt; questions and answers match the visible ones, so the two can't drift apart again.&lt;/p&gt;

&lt;h2&gt;
  
  
  When not to force-mount
&lt;/h2&gt;

&lt;p&gt;Our pricing page had the same problem: the plan details lived in closed accordions. There we didn't force-mount. We added a short, always-visible summary of each plan and kept the accordions for the long detail. If the hidden content is the core of the page, a visible summary is often better than a hidden wall of text.&lt;/p&gt;

&lt;p&gt;Force-mounting fits when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the hidden content is short to medium (FAQ answers, specs, footnotes)&lt;/li&gt;
&lt;li&gt;you prerender or server-render, and you care about what's in the first HTML response&lt;/li&gt;
&lt;li&gt;you control the CSS for the closed state&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Fetch the page's HTML with &lt;code&gt;curl&lt;/code&gt; and grep for text from a closed panel.&lt;/li&gt;
&lt;li&gt;If it's missing, add &lt;code&gt;forceMount&lt;/code&gt; to the content component.&lt;/li&gt;
&lt;li&gt;Hide closed panels yourself with &lt;code&gt;[data-state="closed"] { display: none; }&lt;/code&gt; or Tailwind's &lt;code&gt;data-[state=closed]:hidden&lt;/code&gt;. Radix won't add &lt;code&gt;hidden&lt;/code&gt; for you.&lt;/li&gt;
&lt;li&gt;Test the built HTML, not just the component.&lt;/li&gt;
&lt;li&gt;If you emit FAQ structured data, check it against the visible answers.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;I wrote this with the help of an AI assistant, working from the project's commits and code. The snippets come from the repository, trimmed for length.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>seo</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
    <item>
      <title>I built a simulator for the hiring systems that filter candidates before humans ever see them</title>
      <dc:creator>Luca</dc:creator>
      <pubDate>Tue, 14 Apr 2026 17:38:47 +0000</pubDate>
      <link>https://dev.to/luca151/i-built-a-simulator-for-the-hiring-systems-that-filter-candidates-before-humans-ever-see-them-452d</link>
      <guid>https://dev.to/luca151/i-built-a-simulator-for-the-hiring-systems-that-filter-candidates-before-humans-ever-see-them-452d</guid>
      <description>&lt;p&gt;Most hiring pipelines today start with automated systems.&lt;/p&gt;

&lt;p&gt;Not interviews.&lt;/p&gt;

&lt;p&gt;Systems.&lt;/p&gt;

&lt;p&gt;Things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HireVue game-based assessments&lt;/li&gt;
&lt;li&gt;one-way video interviews&lt;/li&gt;
&lt;li&gt;asynchronous screening platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From a dev perspective, these are not “interviews”.&lt;/p&gt;

&lt;p&gt;They’re black-box evaluation systems with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;constrained inputs (your responses)&lt;/li&gt;
&lt;li&gt;hidden scoring logic&lt;/li&gt;
&lt;li&gt;strict timing constraints&lt;/li&gt;
&lt;li&gt;no feedback loop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And yet, candidates are expected to perform optimally on first exposure.&lt;/p&gt;




&lt;h2&gt;
  
  
  The actual problem
&lt;/h2&gt;

&lt;p&gt;This is not primarily a “skill” issue.&lt;/p&gt;

&lt;p&gt;It’s a &lt;strong&gt;system familiarity problem&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you think about it like engineering:&lt;/p&gt;

&lt;p&gt;You’re being evaluated by a system you’ve never interacted with,&lt;br&gt;
with unknown rules,&lt;br&gt;
under time pressure,&lt;br&gt;
with no debugging.&lt;/p&gt;

&lt;p&gt;That’s a terrible setup.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why candidates fail (technical framing)
&lt;/h2&gt;

&lt;p&gt;From what I’ve seen, failure usually comes from:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Unknown interface
&lt;/h3&gt;

&lt;p&gt;Users don’t understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what inputs are expected&lt;/li&gt;
&lt;li&gt;how interactions map to outcomes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Equivalent to using an API without docs.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Timing constraints
&lt;/h3&gt;

&lt;p&gt;These systems are heavily time-bound.&lt;/p&gt;

&lt;p&gt;You’re effectively dealing with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;real-time decision loops&lt;/li&gt;
&lt;li&gt;limited processing time per action&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think competitive programming, but without knowing the problem format.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Hidden evaluation function
&lt;/h3&gt;

&lt;p&gt;The scoring logic is opaque.&lt;/p&gt;

&lt;p&gt;Candidates don’t know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what signals are being captured&lt;/li&gt;
&lt;li&gt;how they’re weighted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So they optimize blindly.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. No iteration
&lt;/h3&gt;

&lt;p&gt;You don’t get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;retries&lt;/li&gt;
&lt;li&gt;logs&lt;/li&gt;
&lt;li&gt;feedback&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s a single execution with production consequences.&lt;/p&gt;




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

&lt;p&gt;I built &lt;strong&gt;Candidate Falcon&lt;/strong&gt; as a way to simulate these systems.&lt;/p&gt;

&lt;p&gt;Not to “teach interviews”, but to replicate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;interaction patterns&lt;/li&gt;
&lt;li&gt;timing constraints&lt;/li&gt;
&lt;li&gt;cognitive load&lt;/li&gt;
&lt;li&gt;format structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So users can build a mental model &lt;em&gt;before&lt;/em&gt; the real run.&lt;/p&gt;




&lt;h2&gt;
  
  
  Design approach
&lt;/h2&gt;

&lt;p&gt;The goal wasn’t content.&lt;/p&gt;

&lt;p&gt;It was &lt;strong&gt;system replication&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For each assessment type, I focused on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;matching interaction mechanics&lt;/li&gt;
&lt;li&gt;reproducing timing behavior&lt;/li&gt;
&lt;li&gt;simulating decision pressure&lt;/li&gt;
&lt;li&gt;removing ambiguity around flow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Basically:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If the real system is a black box, this is a local sandbox.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Example: game-based assessments
&lt;/h2&gt;

&lt;p&gt;HireVue-style games are not “games” in the traditional sense.&lt;/p&gt;

&lt;p&gt;They’re:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cognitive tasks&lt;/li&gt;
&lt;li&gt;signal extraction pipelines&lt;/li&gt;
&lt;li&gt;behavior measurement tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of strategies like “do X to win”, the useful layer is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understanding task structure&lt;/li&gt;
&lt;li&gt;recognizing patterns early&lt;/li&gt;
&lt;li&gt;allocating attention correctly&lt;/li&gt;
&lt;li&gt;avoiding time-based errors&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Example: one-way video interviews
&lt;/h2&gt;

&lt;p&gt;These are closer to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;async request/response systems&lt;/li&gt;
&lt;li&gt;with strict timeouts&lt;/li&gt;
&lt;li&gt;and no back-and-forth&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difficulty is not answering questions.&lt;/p&gt;

&lt;p&gt;It’s handling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;delayed prompts&lt;/li&gt;
&lt;li&gt;recording constraints&lt;/li&gt;
&lt;li&gt;timeboxing your response&lt;/li&gt;
&lt;li&gt;maintaining coherence under pressure&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;If you’re a dev, this pattern should feel familiar:&lt;/p&gt;

&lt;p&gt;You don’t fail systems because you lack ability.&lt;/p&gt;

&lt;p&gt;You fail because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you don’t understand constraints&lt;/li&gt;
&lt;li&gt;you misread the interface&lt;/li&gt;
&lt;li&gt;you optimize for the wrong signals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the system is understood, performance improves quickly.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I’m testing
&lt;/h2&gt;

&lt;p&gt;Right now I’m trying to validate a simple idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is familiarity with the system enough to significantly improve outcomes?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Early signals suggest yes.&lt;/p&gt;

&lt;p&gt;But I’d like more input, especially from people who’ve gone through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HireVue&lt;/li&gt;
&lt;li&gt;Pymetrics&lt;/li&gt;
&lt;li&gt;Codility / HackerRank-style screens (slightly different, but similar constraints)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Open questions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How would you model these systems more accurately?&lt;/li&gt;
&lt;li&gt;What signals do you think they actually optimize for?&lt;/li&gt;
&lt;li&gt;Where would you draw the line between “prep” and “overfitting”?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you want to see what I mean:&lt;br&gt;
&lt;a href="https://candidatefalcon.com" rel="noopener noreferrer"&gt;https://candidatefalcon.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>saas</category>
      <category>founder</category>
      <category>career</category>
    </item>
  </channel>
</rss>
