<?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: Ayush Mishra</title>
    <description>The latest articles on DEV Community by Ayush Mishra (@fuloxdev).</description>
    <link>https://dev.to/fuloxdev</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%2F4189605%2F27278e5b-8fe7-4ea7-a8c3-98f8e6a46049.png</url>
      <title>DEV Community: Ayush Mishra</title>
      <link>https://dev.to/fuloxdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fuloxdev"/>
    <language>en</language>
    <item>
      <title>Export new jobs from an Oracle Recruiting Cloud careers site to CSV, with pay ranges</title>
      <dc:creator>Ayush Mishra</dc:creator>
      <pubDate>Wed, 18 Nov 2026 10:32:46 +0000</pubDate>
      <link>https://dev.to/fuloxdev/export-new-jobs-from-an-oracle-recruiting-cloud-careers-site-to-csv-with-pay-ranges-4gch</link>
      <guid>https://dev.to/fuloxdev/export-new-jobs-from-an-oracle-recruiting-cloud-careers-site-to-csv-with-pay-ranges-4gch</guid>
      <description>&lt;p&gt;Many large employers run their careers site on Oracle Recruiting Cloud (ORC). Those pages have no export button, and the list shows little beyond a title and a place. This tutorial pulls the open jobs of one such site into a spreadsheet, keeping only recent postings. I built the tool used here, an Apify Actor; it is paid per job ($0.45 per 1,000), and filtered-out jobs are free.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Find the careers URL
&lt;/h2&gt;

&lt;p&gt;An ORC careers site looks like &lt;code&gt;https://&amp;lt;tenant&amp;gt;.fa.&amp;lt;region&amp;gt;.oraclecloud.com/hcmUI/CandidateExperience/en/sites/&amp;lt;site&amp;gt;&lt;/code&gt;. A company address such as careers.oracle.com that redirects to one also works. Example used below: &lt;code&gt;https://eeho.fa.us2.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_45001&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Run the Actor
&lt;/h2&gt;

&lt;p&gt;Open the Oracle Recruiting Jobs Scraper on the Apify Store (link in this post) and paste the URL into &lt;code&gt;startUrls&lt;/code&gt;. If you do not have an Apify account yet, create a free one first.&lt;/p&gt;

&lt;p&gt;Optional filters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;titleKeywords&lt;/code&gt;: keep jobs whose title contains any word, for example &lt;code&gt;engineer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;locationKeywords&lt;/code&gt;: city, state, country or country code.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;postedWithinDays&lt;/code&gt;: for example 7, applied to the real ISO posting date.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;maxItemsPerSite&lt;/code&gt;: start with 25 to check the output cheaply.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click Start.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Read the rows
&lt;/h2&gt;

&lt;p&gt;Each row has title, locations, postedDate, jobId, jobFamily, url, descriptionText and, when the posting states a range, payMin, payMax, payCurrency and payPeriod. Pay fields are null otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Export and repeat
&lt;/h2&gt;

&lt;p&gt;Download JSON, CSV or Excel from the dataset, or connect to Google Sheets, Make, Zapier or n8n. Add a weekly schedule with &lt;code&gt;postedWithinDays: 7&lt;/code&gt; to see only new postings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;p&gt;Oracle Recruiting Cloud sites only (other systems return a free &lt;code&gt;site_failed&lt;/code&gt; row); at most 3,000 jobs per run; sites that block requests stop the run after three blocked jobs, and earlier rows are kept. Not affiliated with Oracle.&lt;/p&gt;

</description>
      <category>apify</category>
      <category>webscraping</category>
      <category>tutorial</category>
      <category>automation</category>
    </item>
    <item>
      <title>One Reminder Email Spent 97 of Our 100 Daily Sign-In Codes</title>
      <dc:creator>Ayush Mishra</dc:creator>
      <pubDate>Wed, 11 Nov 2026 12:25:03 +0000</pubDate>
      <link>https://dev.to/fuloxdev/one-reminder-email-spent-97-of-our-100-daily-sign-in-codes-3kin</link>
      <guid>https://dev.to/fuloxdev/one-reminder-email-spent-97-of-our-100-daily-sign-in-codes-3kin</guid>
      <description>&lt;p&gt;I found it by reading a send log, not a page. Dozens of "The fire is lit" emails had gone out at 8pm, and an hour later the daily counter on our Resend account read 97 of 100. Three sign-in codes were left for the rest of the day, during the one hour people were actually trying to log in.&lt;/p&gt;

&lt;p&gt;Fyreflock is a random video and text chat app. It runs a feature I'd nicknamed the campfire: the matching queue only opens in set evening windows, and if you'd asked to be told when it opens, we'd email you. Turns out that email and the one carrying your sign-in code were drawing from the same tap, and nobody had told the tap it had two jobs.&lt;/p&gt;

&lt;h2&gt;
  
  
  One account, two very different emails
&lt;/h2&gt;

&lt;p&gt;Resend's free plan gives you 100 sends a day. For a year, every email Fyreflock sent went through the same account on that plan: sign-in codes, the campfire nudge, award notices, the eventual launch broadcast. The code that watched for the campfire opening looked like this:&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;// apps/server/src/reminders.ts, before the fix&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;checkCampfireOpening&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AppCtx&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="nc"&gt;ReminderResult&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;isOpen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fire&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;enabled&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;fire&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&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;isOpen&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;wasOpen&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;opened&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;sent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;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;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mailer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sendAnnouncement&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;opened&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;sent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;due&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sb"&gt;`SELECT id, email, unsub_token FROM waitlist
     WHERE remind = 1 AND (last_reminded_at IS NULL OR last_reminded_at &amp;lt; ?)
     LIMIT 500`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;MIN_GAP_MS&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;row&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;due&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mailer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendAnnouncement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'The fire is lit 🔥'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;reminderText&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="c1"&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 runs once a minute, watching for the closed-to-open edge. The day it fired, 102 people were on the waitlist with &lt;code&gt;remind = 1&lt;/code&gt;. &lt;code&gt;LIMIT 500&lt;/code&gt; was never going to bind anything, so the whole batch went out in one pass, against the same 100-a-day account that &lt;code&gt;sendCode&lt;/code&gt; uses for every sign-in. Do that at 8pm, the hour the queue opens and the hour people try to sign in, and you've built a feature whose entire job is to compete with login for the same daily allowance.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;sequenceDiagram
    participant Clock as reminder loop (every 60s)
    participant DB as waitlist table
    participant Mail as shared Resend account (100/day)
    participant Login as someone signing in

    Clock-&amp;gt;&amp;gt;DB: campfire just opened, who's owed a nudge?
    DB--&amp;gt;&amp;gt;Clock: 102 rows, remind = 1
    loop up to 500 rows, no pacing
        Clock-&amp;gt;&amp;gt;Mail: sendAnnouncement("the fire is lit")
    end
    Note over Mail: 97 of 100 spent in under a minute
    Login-&amp;gt;&amp;gt;Mail: sendCode(code)
    Mail--&amp;gt;&amp;gt;Login: 429, quota's gone for today&lt;/code&gt;&lt;/pre&gt;



&lt;h2&gt;
  
  
  The fix that shipped that evening
&lt;/h2&gt;

&lt;p&gt;I wasn't going to redesign the mail layer at 9pm with the queue still open. The honest fix was small: turn the nudge off by default, and bound it when it's on.&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="nf"&gt;getSetting&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'reminders_enabled'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'1'&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;opened&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;sent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;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;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mailer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sendAnnouncement&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;opened&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;sent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;batch&lt;/span&gt; &lt;span class="o"&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;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getSetting&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'reminder_batch_max'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;25&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;due&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="sb"&gt;`SELECT id, email, unsub_token FROM waitlist
   WHERE remind = 1 AND (last_reminded_at IS NULL OR last_reminded_at &amp;lt; ?)
   ORDER BY created_at ASC LIMIT ?`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;MIN_GAP_MS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;batch&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;reminders_enabled&lt;/code&gt; defaults to &lt;code&gt;'0'&lt;/code&gt;. Someone has to look at the day's headroom and switch it on. &lt;code&gt;reminder_batch_max&lt;/code&gt; caps it at 25 even then, because 500 was never a number any Resend plan we're on could honor.&lt;/p&gt;

&lt;p&gt;The subtle part is where that switch gets read. It has to come &lt;em&gt;after&lt;/em&gt; the open/closed edge gets recorded, not before, or flipping it mid-window finds a stale &lt;code&gt;wasOpen = 0&lt;/code&gt; and fires immediately at whoever just flipped it, which is the exact kind of surprise burst the switch exists to stop. Off has to mean silent, not blind: the edge-tracking keeps running while it's off, so turning it on waits for the &lt;em&gt;next&lt;/em&gt; opening instead of the one already in progress. I wrote a test for exactly that, because it reads as obviously correct until you trace what happens if you flip the switch at 20:01 instead of 19:59.&lt;/p&gt;

&lt;p&gt;One other test was wrong before it was right. I seeded the batch-cap case by posting to &lt;code&gt;/api/waitlist&lt;/code&gt; in a loop, and the assertion kept failing: looked like the cap logic was broken. It wasn't. That endpoint rate-limits signups to 5 an hour per IP, so my own test harness was the thing capping the rows at 5, not the code I was testing. Writing rows straight into the table fixed the test and taught me to read my own rate limits before blaming the feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix that actually ends it
&lt;/h2&gt;

&lt;p&gt;Default-off and a cap of 25 make the lockout impossible rather than merely unlikely. That was a deliberate choice, written into the commit at the time, to not redesign the send path on an evening I was also trying to put a fire out. Six weeks later I came back and gave sign-in codes an account that nothing else touches.&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;// apps/server/src/mailer.ts&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SplitMailer&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Mailer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;codes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Mailer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;bulk&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Pick&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Required&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Mailer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'sendAnnouncement'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&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;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;bulk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sendAnnouncement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subject&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="n"&gt;opts&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;bulk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendAnnouncement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subject&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="n"&gt;opts&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;sendCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&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;code&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="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;codes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// never shared with announcements&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;sendCode&lt;/code&gt; goes through the old fallback chain, untouched. &lt;code&gt;sendAnnouncement&lt;/code&gt; goes to a pool of separate free Resend accounts, and the two paths never cross: if every bulk account is spent, the broadcast fails outright instead of falling back to the codes account, which is exactly the fall-through that caused the original lockout. With no bulk accounts configured, &lt;code&gt;sendAnnouncement&lt;/code&gt; is &lt;code&gt;undefined&lt;/code&gt;, and every caller already checks for that before using it.&lt;/p&gt;

&lt;p&gt;Picking which bulk account handles a given person was the part I almost got wrong in the obvious direction. Rotating senders per email looks like the move to dodge spam filters. It's closer to the opposite:&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="n"&gt;sendAnnouncement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subject&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="n"&gt;opts&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;=&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;home&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&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="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="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&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="c1"&gt;// ring.map rotates the account list starting at `home`, so the same person&lt;/span&gt;
  &lt;span class="c1"&gt;// always lands on the same account unless it's exhausted or refused&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;Spreading one person's mail across several sending domains over time is what filters call snowshoe spam, and it also means that person never builds the open/reply history on any one domain that actually earns the inbox. A hash keeps everyone on their own account by default. It's stateless, costs a few microseconds, and needs no rotation pointer to persist, and it only moves someone to the next account in the ring if theirs is full or refused for the day.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    A[sendCode] --&amp;gt; B[codes account\nalways, never shared]
    C[sendAnnouncement] --&amp;gt; D{hash of recipient}
    D --&amp;gt;|picks home account| E[ResendPool]
    E --&amp;gt;|exhausted or refused?| F[next account in the ring]
    F --&amp;gt;|still exhausted?| F
    E --&amp;gt;|all exhausted| G[fails loud: BulkQuotaExhausted]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;A brand-new subdomain sending 95 emails on day one reads to Gmail like a stranger shouting, so each bulk account also ramps its own cap up from its first send: 20/day for 3 days, 40 through the first week, 70 through the second, then the full cap. That cap sits below Resend's real limit on purpose, so our count and theirs can drift without turning into a refusal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqz4iacsc00xtz833y8lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqz4iacsc00xtz833y8lm.png" alt="How a new bulk mail account ramps up, read from mailer.ts's warmup() function" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That count lives in a &lt;code&gt;mail_quota&lt;/code&gt; table, one row per account per UTC day, because a restart mid-evening would otherwise forget what had already gone out and walk an account straight into Resend's wall a second time. Resend's own refusal still wins over our count whenever it disagrees: the moment an account answers with a quota error, or with anything that won't clear today (a bad key, a domain Resend hasn't cleared for sending), it gets marked exhausted and skipped for the rest of the day, no matter what our counter says. The two-requests-a-second rate limit is the one exception, since that clears in about a second and retrying it once is cheaper than retiring a perfectly healthy account over a batch that went out slightly too fast.&lt;/p&gt;

&lt;p&gt;Both switches (the campfire nudge and the re-engagement email I added at the same time) ship off, and the day's usage per account now lives on an admin dashboard card instead of a database row I'd have had to edit by hand to check.&lt;/p&gt;

&lt;h2&gt;
  
  
  What else came out of the same fix
&lt;/h2&gt;

&lt;p&gt;Tightening one path exposed a second bug living next to it: an admin "notify everyone" button that marked every waitlist row as notified even when there was no bulk account configured to send through. It spent each person's one lifetime launch email on silence and reported success while doing it. Harmless as long as the codes account could still double as a fallback announcer, and live the moment that fallback was removed on purpose. It now refuses with a 503 instead of lying about what it sent.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;I'd set myself a deadline for the real fix the same evening I shipped the quick one. "Off by default plus a cap" was the right call for that evening, and it also quietly became the permanent state for six weeks, because a feature that's off by default stops feeling urgent the moment it stops breaking things. Nothing forced me back to it; I just happened to need bulk mail for something else and ran into the same account limit again.&lt;/p&gt;

&lt;p&gt;So: would you rather ship the conservative stopgap and trust yourself to come back to it, or hold the fix until the real architecture is ready, even if that means the feature stays off for longer than anyone wants? I went with the first one and got lucky that nothing else leaned on that account in the meantime. I'm less sure I'd make the same call on a path with more than one feature behind it.&lt;/p&gt;

</description>
      <category>node</category>
      <category>webdev</category>
      <category>showdev</category>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>My MCP app shipped every update to nobody until they reconnected</title>
      <dc:creator>Ayush Mishra</dc:creator>
      <pubDate>Wed, 04 Nov 2026 17:49:44 +0000</pubDate>
      <link>https://dev.to/fuloxdev/my-mcp-app-shipped-every-update-to-nobody-until-they-reconnected-3m2p</link>
      <guid>https://dev.to/fuloxdev/my-mcp-app-shipped-every-update-to-nobody-until-they-reconnected-3m2p</guid>
      <description>&lt;p&gt;The first deploy of games in Fyreflock's chat box went out with no Play button. The site was on the new build, the server was serving the new page, and Claude Desktop kept drawing the old one anyway, because it had cached the box under its URI and had no reason to ask again.&lt;/p&gt;

&lt;p&gt;Fixing it took two more tries over the next two days, and the first of those made things worse. This is all three versions, and what the one that stuck costs on every open.&lt;/p&gt;

&lt;h2&gt;
  
  
  The box, briefly
&lt;/h2&gt;

&lt;p&gt;Fyreflock is a random chat app, and part of it runs inside AI chats as an MCP server. When you ask Claude or ChatGPT to open it, the model calls one tool, &lt;code&gt;fyreflock_open&lt;/code&gt;, and the host draws an MCP App: an HTML page in a sandboxed iframe. From then on you type into that box and it talks to my server directly. The model is out of the loop.&lt;/p&gt;

&lt;p&gt;The tool points at the page through &lt;code&gt;_meta&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="c1"&gt;// apps/server/src/mcp/app/index.ts&lt;/span&gt;
&lt;span class="nf"&gt;registerAppTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fyreflock_open&lt;/span&gt;&lt;span class="dl"&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;// ...&lt;/span&gt;
  &lt;span class="na"&gt;_meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;ui&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;resourceUri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;APP_RESOURCE_URI&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;openai/outputTemplate&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;APP_RESOURCE_URI&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* ... */&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the page itself is a resource registered under that same URI. Simple enough. The host reads the tool list, sees the URI, fetches the resource, renders it.&lt;/p&gt;

&lt;p&gt;The catch is the word "fetches". It means once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt 1: a fixed URI, &lt;code&gt;ui://fyreflock/chat&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This was the original. One URI, one page, the page rebuilt on every deploy.&lt;/p&gt;

&lt;p&gt;I already had a hint this would bite. On 2026-10-19 I'd watched ChatGPT serve the box from its cache across a page reload. Then the games deploy landed, and a Claude Desktop that had opened the box before kept the pre-games page. Hosts cache an MCP App by its URI and don't read it again. From the server's side, nothing was wrong. Every request that reached me got the new page. The requests just stopped coming.&lt;/p&gt;

&lt;p&gt;So any change to the box shipped to exactly the people who had never seen it, which for a feature in its first week is roughly nobody.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt 2: put a hash in the URI
&lt;/h2&gt;

&lt;p&gt;The obvious fix for a cache keyed by name is to change the name:&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;// ace4245, since replaced&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;APP_RESOURCE_URI&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="s2"&gt;`ui://fyreflock/chat/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;createHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sha256&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;HTML&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same bytes, same URI. New bytes, new URI, cache miss, fresh page. Cache busting the way every bundler does it, and I shipped it feeling pretty clever.&lt;/p&gt;

&lt;p&gt;It got past the page cache and walked straight into the next one. The host doesn't discover the URI on its own. It learns it from the tool list, and it reads the tool list when the connector connects. So a host connected yesterday still held yesterday's tool list, which still pointed at yesterday's hash.&lt;/p&gt;

&lt;p&gt;And that hash no longer existed on my server. The resource was registered under the current hash only. A person who hadn't reconnected didn't get an old box. They got a box that failed to load.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    A[Deploy: box bytes change] --&amp;gt; B[Server registers ui://fyreflock/chat/NEWHASH]
    C[Host connected last week] --&amp;gt; D[Its tool list still says OLDHASH]
    D --&amp;gt; E[Host asks for ui://fyreflock/chat/OLDHASH]
    B --&amp;gt; F{Server has OLDHASH?}
    E --&amp;gt; F
    F --&amp;gt;|no| G[Resource not found, no box at all]
    F --&amp;gt;|"yes, only if they reconnect"| H[New box]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;So the hash turned "people see an old box until they reconnect" into "people see no box until they reconnect". Strictly worse. In my defence it lasted a day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attempt 3: cache the loader, fetch the box
&lt;/h2&gt;

&lt;p&gt;If the host is going to keep whatever sits at the URI forever, the fix is to make the thing it keeps not matter. The URI went back to fixed, &lt;code&gt;ui://fyreflock/box/v1&lt;/code&gt;, and what it holds now is a loader. Every time it opens, the loader asks my site for the current box as a plain script, &lt;code&gt;/box/live.js&lt;/code&gt;, and mounts whatever comes back.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;sequenceDiagram
    participant H as Host (Claude, ChatGPT)
    participant L as Cached loader, ui://fyreflock/box/v1
    participant S as fyreflock.com
    H-&amp;gt;&amp;gt;L: open the box (from its cache)
    L-&amp;gt;&amp;gt;S: script src /box/live.js
    alt script arrives in time
        S--&amp;gt;&amp;gt;L: window.__fyreflockBox(current page)
        L-&amp;gt;&amp;gt;L: mount it, data-box-from=live
    else refused, error, or 4 s passes
        L-&amp;gt;&amp;gt;L: mount the copy it was built with, data-box-from=inline
    end&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The script is just one function call with the whole page as a string:&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;// apps/server/src/mcp/app/index.ts&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;boxLiveScript&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;string&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;`window.__fyreflockBox(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;literal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;page&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;))}&lt;/span&gt;&lt;span class="s2"&gt;);\n`&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;That &lt;code&gt;literal&lt;/code&gt; is doing more than it looks like. It's &lt;code&gt;JSON.stringify&lt;/code&gt; plus one replace, because a raw &lt;code&gt;&amp;lt;/script&lt;/code&gt; anywhere inside that string would end the loader's script tag in the middle of the box:&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="nx"&gt;literal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&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="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replaceAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's a test for exactly that, since it's the kind of thing that works fine until the games bundle happens to contain the string.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why a script tag and not fetch
&lt;/h3&gt;

&lt;p&gt;Two reasons. A &lt;code&gt;&amp;lt;script src&amp;gt;&lt;/code&gt; from a domain the app declares in its CSP &lt;code&gt;resourceDomains&lt;/code&gt; is something hosts already allow, and I had a probe for it: a test widget I run inside real hosts, whose check 1d loads a script from a declared domain and reports whether it ran. On 2026-10-28 it loaded in Claude Desktop and claude.ai. ChatGPT I haven't measured, and if it refuses, the loader mounts its built-in copy, which is exactly what everyone got before. Nobody ends up worse off.&lt;/p&gt;

&lt;p&gt;The second reason is that mounting someone else's HTML into your document doesn't run its scripts. Neither &lt;code&gt;DOMParser&lt;/code&gt; nor &lt;code&gt;importNode&lt;/code&gt; will execute a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; they bring along. So the loader swaps in the new head and body, then replaces every script element with a fresh clone, because a freshly created script element is one the browser will actually run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// boxShell() in apps/server/src/mcp/app/index.ts, trimmed&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DOMParser&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;parseFromString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/html&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replaceWith&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;importNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;head&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="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replaceWith&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;importNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;scripts&lt;/span&gt; &lt;span class="o"&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;script&lt;/span&gt;&lt;span class="dl"&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;var&lt;/span&gt; &lt;span class="nx"&gt;j&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="nx"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;scripts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;j&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="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;old&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;scripts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="o"&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;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;script&lt;/span&gt;&lt;span class="dl"&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;var&lt;/span&gt; &lt;span class="nx"&gt;k&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="nx"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replaceWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;run&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 &lt;code&gt;mounted&lt;/code&gt; flag makes the first copy to arrive win, so a slow live script landing after the four second fallback doesn't mount a second box on top of the first.&lt;/p&gt;

&lt;h3&gt;
  
  
  The old hashes still get answered
&lt;/h3&gt;

&lt;p&gt;Hosts that read their tool list during attempt 2 still ask for hashed URIs. Instead of refusing them, the server registers a resource template that matches any of them and hands back the loader:&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="nx"&gt;HASHED_URI&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ResourceTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ui://fyreflock/chat/{version}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// Answered rather than refused: a host still holding an old tool list asks for a hash this server no longer has.&lt;/span&gt;
&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Fyreflock chat (earlier address)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;HASHED_URI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="cm"&gt;/* ... */&lt;/span&gt;
  &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;uri&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="na"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;mimeType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;RESOURCE_MIME_TYPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;boxShell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="cm"&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;People connected during the hash day needed one more reconnect to pick up &lt;code&gt;v1&lt;/code&gt;. After that, a deploy reaches them the next time they open the box. Testing it in my fake host covered the handshake surviving the mount, an unreachable site falling back in about 110 ms, a non-script response, a CSP that blocks it, and a loader captured before a change mounting the changed box.&lt;/p&gt;

&lt;h2&gt;
  
  
  What being current costs
&lt;/h2&gt;

&lt;p&gt;Here's the bill. I fetched &lt;code&gt;/box/live.js&lt;/code&gt; from production 50 times today, one fresh connection each:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qzmsibgylplgsy83dae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qzmsibgylplgsy83dae.png" alt="Fetch time for /box/live.js: median 1173 ms uncompressed, 837 ms gzipped, 523 ms for a 304, all far under the 4 second fallback" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The box is 488 KB of JavaScript as a string, 167 KB gzipped. The chat widget is 110 KB of that; the games bundle is the rest. Even the slowest uncompressed run, 2.9 s, came in well before the loader's four second give-up. The 304 is the interesting row. It moves zero bytes and still costs about half a second, because it's still a round trip to the origin before anything can draw.&lt;/p&gt;

&lt;p&gt;That was the first version of attempt 3: &lt;code&gt;Cache-Control: no-cache&lt;/code&gt;, so every open revalidated and an unchanged box came back as a 304. Correct, and a round trip to the origin on every single open. The next day it became this:&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;// apps/server/src/http.ts&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/javascript&lt;/span&gt;&lt;span class="dl"&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;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Cache-Control&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public, max-age=60, stale-while-revalidate=86400&lt;/span&gt;&lt;span class="dl"&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;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;live&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A minute of plain caching, then a day where the browser may draw the copy it has at once and refetch behind it. I didn't lean on Cloudflare for this because, per the comment I left myself, its Free plan won't cache for less than two hours on its own, and a deploy that takes two hours to show up is the problem I started with.&lt;/p&gt;

&lt;p&gt;The price is honest staleness. In a browser that honours &lt;code&gt;stale-while-revalidate&lt;/code&gt;, the first open after a deploy can draw the previous box instantly while fetching the new one, and the open after that is current. I traded "always current, always half a second late" for "instant, one open behind".&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that's still wrong
&lt;/h2&gt;

&lt;p&gt;The loader carries its fallback inline, the full page as of the day the host fetched it. So the loader is about as big as the live script, 488 KB, and the copy inside it only gets older. If my site is unreachable a month from now, a host that cached &lt;code&gt;v1&lt;/code&gt; today will mount a month-old box. That's fine for chat and less fine for a game whose rules changed since.&lt;/p&gt;

&lt;p&gt;And the loader itself is now the one thing I can never update without asking everybody to reconnect. Any change to it ships with &lt;code&gt;v2&lt;/code&gt;, and I've written that rule into the code comment above &lt;code&gt;APP_RESOURCE_URI&lt;/code&gt; so I can't forget it on a Friday.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;Probe before cache busting. The hash looked right because I was reasoning about one cache. There were two, the page cache and the tool list, and the second one is invisible from the server unless you log which URIs hosts actually request. A single log line on resource URIs the server doesn't know would have shown the broken boxes the first time a host asked for one.&lt;/p&gt;

&lt;p&gt;I'd also have started with the loader. "The thing that gets cached forever should be tiny and dumb" is old advice from service workers, and I relearned it the slow way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tradeoff I'm still chewing on
&lt;/h2&gt;

&lt;p&gt;The fallback is either a fat inline copy that ages, or no copy at all and a box that shows nothing when my site is down. Right now I keep the fat copy. If you've shipped UI into a host that caches you forever (MCP Apps, browser extensions, embedded widgets), which did you pick: a stale fallback, or failing visibly so people know something's wrong?&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>ai</category>
    </item>
    <item>
      <title>Compare Google Trends keywords in bulk without pytrends</title>
      <dc:creator>Ayush Mishra</dc:creator>
      <pubDate>Sun, 01 Nov 2026 09:35:43 +0000</pubDate>
      <link>https://dev.to/fuloxdev/compare-google-trends-keywords-in-bulk-without-pytrends-21hg</link>
      <guid>https://dev.to/fuloxdev/compare-google-trends-keywords-in-bulk-without-pytrends-21hg</guid>
      <description>&lt;p&gt;If you track search interest weekly, a pytrends script tends to stop with HTTP 429 sooner or later. This tutorial runs the same job with an Apify Actor I built, &lt;a href="https://apify.com/fulox/google-trends-scraper" rel="noopener noreferrer"&gt;Google Trends Scraper&lt;/a&gt;, and puts the result in a spreadsheet. Disclosure: the Actor is mine and paid per keyword.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you get
&lt;/h2&gt;

&lt;p&gt;For every keyword, one row with interest over time, interest by region and top and rising related queries. Up to five keywords are compared on one 0-100 scale, the way Google Trends compares them. The values are relative interest, never search volume.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create a free Apify account
&lt;/h2&gt;

&lt;p&gt;Sign up at apify.com and open the Actor page linked above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Enter keywords
&lt;/h2&gt;

&lt;p&gt;Put 2 to 5 keywords you want to compare in &lt;code&gt;keywords&lt;/code&gt;, for example pickleball and padel. Pick &lt;code&gt;geo&lt;/code&gt; (US, GB, or empty for worldwide) and &lt;code&gt;timeRange&lt;/code&gt; (default &lt;code&gt;today 12-m&lt;/code&gt;). Keep related terms in the same group of five if you want to compare them: each group of five has its own scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Run it
&lt;/h2&gt;

&lt;p&gt;Click Start. The default two-keyword run costs $0.006 (two &lt;code&gt;ok&lt;/code&gt; rows at $0.003). Set a maximum cost per run if you like; the run stops when it is reached.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Read the rows
&lt;/h2&gt;

&lt;p&gt;Each row has &lt;code&gt;status&lt;/code&gt;: &lt;code&gt;ok&lt;/code&gt;, &lt;code&gt;no_data&lt;/code&gt;, &lt;code&gt;partial&lt;/code&gt; or &lt;code&gt;error&lt;/code&gt;. Only &lt;code&gt;ok&lt;/code&gt; is charged. Useful fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;comparedWith&lt;/code&gt;: the other keywords on the same scale.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;peak&lt;/code&gt; and &lt;code&gt;latest&lt;/code&gt;: the highest point and the most recent one.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;regions&lt;/code&gt;: interest by region.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;relatedRising&lt;/code&gt;: queries gaining interest ("Breakout" means a very large increase).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The README shows the row shape; the values there are a sample, not a real Google record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Schedule it
&lt;/h2&gt;

&lt;p&gt;Schedule the Actor weekly and connect the dataset to Google Sheets, Make, Zapier or n8n.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;p&gt;Google can slow down or refuse requests. The Actor pauses between requests, refreshes its cookie once, then stops with an explanation row. Failed keywords are not charged. It runs on Apify Proxy datacenter only. Not affiliated with Google.&lt;/p&gt;

</description>
      <category>apify</category>
      <category>webscraping</category>
      <category>tutorial</category>
      <category>automation</category>
    </item>
    <item>
      <title>Search a YouTube channel's transcripts and get alerts for new uploads (Apify, no code)</title>
      <dc:creator>Ayush Mishra</dc:creator>
      <pubDate>Sat, 31 Oct 2026 13:55:06 +0000</pubDate>
      <link>https://dev.to/fuloxdev/search-a-youtube-channels-transcripts-and-get-alerts-for-new-uploads-apify-no-code-2ao7</link>
      <guid>https://dev.to/fuloxdev/search-a-youtube-channels-transcripts-and-get-alerts-for-new-uploads-apify-no-code-2ao7</guid>
      <description>&lt;p&gt;You want to know what a YouTube channel said about a topic, and hear about it when it says it again. This walkthrough uses the YouTube Transcript Scraper Actor, which I built. Disclosure: it is my own Actor, priced at $1.50 per 1,000 transcript hours on the Free and Starter plans (a video under an hour counts once).&lt;/p&gt;

&lt;p&gt;Actor: &lt;a href="https://apify.com/fulox/youtube-transcript-scraper" rel="noopener noreferrer"&gt;https://apify.com/fulox/youtube-transcript-scraper&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Try the default input
&lt;/h2&gt;

&lt;p&gt;Open the Actor and click Start. It reads two public videos and costs about $0.003. Open the dataset: each &lt;code&gt;video&lt;/code&gt; row has &lt;code&gt;text&lt;/code&gt;, &lt;code&gt;segments&lt;/code&gt;, &lt;code&gt;chapters&lt;/code&gt;, &lt;code&gt;quality&lt;/code&gt; and &lt;code&gt;matches&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Preview a channel for free
&lt;/h2&gt;

&lt;p&gt;Paste a channel into Videos, channels or playlists, for example &lt;code&gt;@mkbhd&lt;/code&gt;, set Videos per channel to 20 and turn on List only. You get one free &lt;code&gt;preview&lt;/code&gt; row per video with its length, caption languages and &lt;code&gt;estimatedResults&lt;/code&gt;, the number of results a real run would charge. Nothing is downloaded or charged.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Search the transcripts
&lt;/h2&gt;

&lt;p&gt;Turn List only off. Add search terms such as &lt;code&gt;battery life&lt;/code&gt;, set formats to empty (&lt;code&gt;[]&lt;/code&gt;) if you only want quotes, and turn on &lt;code&gt;matchRows&lt;/code&gt;. Run. Each &lt;code&gt;match&lt;/code&gt; row has the term, the second, a quote and a &lt;code&gt;youtu.be/&amp;lt;id&amp;gt;?t=&amp;lt;seconds&amp;gt;&lt;/code&gt; link. Clicking it opens the video at that moment. Matching is case-insensitive text matching, not meaning-based. Matches are free; you pay for the transcripts delivered.&lt;/p&gt;

&lt;p&gt;Here is a real match from the Stanford 2005 commencement address:&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="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"term"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"connecting the dots"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;55.85&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0:55"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://youtu.be/UF8uR6Z6KLc?t=55"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"quote"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"...The first story is about connecting the dots. I dropped out of Reed College..."&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Get only new uploads
&lt;/h2&gt;

&lt;p&gt;Turn on Watch mode, give it a &lt;code&gt;watchlistName&lt;/code&gt;, and optionally paste a Slack incoming-webhook URL. Open Schedules, create a daily schedule with this saved input. The first run delivers the existing videos (use &lt;code&gt;publishedAfter&lt;/code&gt; such as &lt;code&gt;7 days&lt;/code&gt; to limit that); later runs deliver only new uploads, and Slack gets a message with the new videos and the top quotes only when something is new.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Use the output for AI
&lt;/h2&gt;

&lt;p&gt;Set formats to &lt;code&gt;chunks&lt;/code&gt; for RAG chunks with a stable id, start and end seconds, token estimate and deep link, or &lt;code&gt;markdown&lt;/code&gt; for a document with front matter. Check &lt;code&gt;quality.grade&lt;/code&gt; (A to D) before you embed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it cannot do
&lt;/h2&gt;

&lt;p&gt;It reads existing captions: a video without captions is a free &lt;code&gt;no_captions&lt;/code&gt; row, there is no audio transcription and no translation, and YouTube can change how it serves captions. Questions or bugs go to the Actor's Issues tab.&lt;/p&gt;

</description>
      <category>apify</category>
      <category>webscraping</category>
      <category>tutorial</category>
      <category>automation</category>
    </item>
    <item>
      <title>Track a competitor's hiring with Apify and Google Sheets</title>
      <dc:creator>Ayush Mishra</dc:creator>
      <pubDate>Fri, 30 Oct 2026 15:32:04 +0000</pubDate>
      <link>https://dev.to/fuloxdev/track-a-competitors-hiring-with-apify-and-google-sheets-4ea2</link>
      <guid>https://dev.to/fuloxdev/track-a-competitors-hiring-with-apify-and-google-sheets-4ea2</guid>
      <description>&lt;p&gt;Hiring is one of the clearest public signals of what a company plans to do. Here is how to watch a list of companies and get only the job postings that changed, using an Apify Actor I built: &lt;a href="https://apify.com/fulox/ats-hiring-signals" rel="noopener noreferrer"&gt;Job Postings API &amp;amp; Change Tracker&lt;/a&gt;. It reads Greenhouse, Lever, Ashby, SmartRecruiters, Workable, Recruitee and Personio, and nothing else.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Add companies
&lt;/h2&gt;

&lt;p&gt;Paste company domains (&lt;code&gt;acme.com&lt;/code&gt;) or career-page links into &lt;code&gt;boards&lt;/code&gt;, up to 100. The job board is detected for you, free. If detection misses, write the board yourself: &lt;code&gt;greenhouse:vercel&lt;/code&gt;, &lt;code&gt;ashby:linear&lt;/code&gt;, &lt;code&gt;lever:spotify&lt;/code&gt;, &lt;code&gt;smartrecruiters:Bosch&lt;/code&gt;, &lt;code&gt;workable:mindvalley&lt;/code&gt;, &lt;code&gt;recruitee:bunq&lt;/code&gt;, &lt;code&gt;personio:acme&lt;/code&gt;. Give the list a &lt;code&gt;watchlistName&lt;/code&gt; if you track several lists; each name keeps its own snapshots.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. First run
&lt;/h2&gt;

&lt;p&gt;Click Start. The first run lists every open posting (turn &lt;code&gt;emitBaseline&lt;/code&gt; off to only record the starting point). Use &lt;code&gt;titleIncludes&lt;/code&gt;, &lt;code&gt;departments&lt;/code&gt;, &lt;code&gt;locations&lt;/code&gt; or &lt;code&gt;remoteOnly&lt;/code&gt; to list only the roles you care about. Each company also gets a &lt;code&gt;type: board&lt;/code&gt; row with open roles, roles per function and a &lt;code&gt;signal&lt;/code&gt; (surge, freeze, expanding, contracting, steady).&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Later runs
&lt;/h2&gt;

&lt;p&gt;Run it again, or schedule it daily or weekly. Now you get only changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;type: posting&lt;/code&gt; with &lt;code&gt;status&lt;/code&gt; new, closed or changed (with &lt;code&gt;changedFields&lt;/code&gt; and &lt;code&gt;previous&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;type: board&lt;/code&gt; with &lt;code&gt;newCount&lt;/code&gt;, &lt;code&gt;closedCount&lt;/code&gt;, &lt;code&gt;newFunctions&lt;/code&gt;, &lt;code&gt;leadershipHires&lt;/code&gt;, &lt;code&gt;techStack&lt;/code&gt; and open roles 7 and 30 days ago&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A function hiring for the first time (&lt;code&gt;newFunctions&lt;/code&gt;) or a leadership hire is usually the strongest signal for outreach. Function, seniority and tool tags come from fixed word lists, so use them to filter and count, not as exact facts.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Send it somewhere
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Google Sheets: in the Actor's Integrations tab connect Google Sheets, then filter the &lt;code&gt;type&lt;/code&gt; column to &lt;code&gt;posting&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Slack: paste an incoming-webhook URL into &lt;code&gt;slackWebhookUrl&lt;/code&gt;; a digest is posted only when something changed, and it is free. &lt;code&gt;webhookUrl&lt;/code&gt; sends the same digest as JSON.&lt;/li&gt;
&lt;li&gt;Clay or any HTTP tool: call the Actor's &lt;code&gt;run-sync-get-dataset-items&lt;/code&gt; endpoint with body &lt;code&gt;{"boards":["{{domain}}"],"emitBaseline":false}&lt;/code&gt; and read &lt;code&gt;signal&lt;/code&gt;, &lt;code&gt;summary&lt;/code&gt; and &lt;code&gt;leadershipHires&lt;/code&gt; from the board row.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cost and limits
&lt;/h2&gt;

&lt;p&gt;$1.50 per 1,000 results; a quiet company costs $0.0015 a day. Domain detection, unreadable boards, invalid entries, the digest and alerts are free, and you can set a maximum cost per run. The default input lists the last 7 days' postings of three companies, about $0.02; with &lt;code&gt;postedWithinDays&lt;/code&gt; cleared on a first run the same three list about 200 postings, about $0.30. Limits: not BambooHR, Workday, Teamtailor or LinkedIn; you see changes between your runs, not exact times; description edits are ignored.&lt;/p&gt;

&lt;p&gt;Disclosure: I built this Actor.&lt;/p&gt;

</description>
      <category>apify</category>
      <category>sales</category>
      <category>automation</category>
      <category>data</category>
    </item>
    <item>
      <title>Two AI chats, one game board, and a server that trusts neither</title>
      <dc:creator>Ayush Mishra</dc:creator>
      <pubDate>Wed, 28 Oct 2026 19:06:44 +0000</pubDate>
      <link>https://dev.to/fuloxdev/two-ai-chats-one-game-board-and-a-server-that-trusts-neither-3770</link>
      <guid>https://dev.to/fuloxdev/two-ai-chats-one-game-board-and-a-server-that-trusts-neither-3770</guid>
      <description>&lt;p&gt;Every game in Fyreflock was written for two browsers in lockstep, with no referee anywhere. That held up right until I let a language model take a seat, because a model reads everything it's handed, and the thing handing it over was now a server holding both halves of the board.&lt;/p&gt;

&lt;p&gt;Some context. Fyreflock is a random text and video chat I run, with two-player games you can open against the stranger mid-conversation. It also has an MCP connector for Claude, ChatGPT and Claude Code (&lt;a href="https://github.com/FuloxDev/fyreflock-claude" rel="noopener noreferrer"&gt;github.com/FuloxDev/fyreflock-claude&lt;/a&gt;, which holds the plugin and setup; the server code quoted below lives in the main app). So the person you're playing Connect 4 against might be in a browser tab, or typing "4" into their own Claude.&lt;/p&gt;

&lt;p&gt;This is how the games survived that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lockstep games keep secrets by not sending them
&lt;/h2&gt;

&lt;p&gt;Between two browsers, both sides run the same pure reducer from the same seed. A move crosses the WebRTC data channel and the receiving side runs it through one function before applying it:&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;// packages/shared/src/games/sync.ts (trimmed)&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ingestMove&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;M&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;def&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;GameDef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;M&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;M&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Seat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MoveHashes&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="nx"&gt;def&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isLegal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seat&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="na"&gt;ok&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="na"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ignored&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;def&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;verifyIncoming&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="nx"&gt;honest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;def&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verifyIncoming&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seat&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="o"&gt;=&amp;gt;&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="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;honest&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="na"&gt;ok&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="na"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cheat&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;def&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seat&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// ...plus a state-hash comparison that only means something between lockstep peers&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;ok&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="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;next&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;Secrets are handled by omission. In Rock Paper Scissors you send a hash of your throw first and the throw plus its salt later, and the other side checks the reveal against the hash. A Battleship fleet never leaves the device that placed it. Nobody needs a referee, because neither peer ever holds the other one's secret.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then a model sits down
&lt;/h2&gt;

&lt;p&gt;The connector lets an assistant play through tools: &lt;code&gt;fyreflock_game_invite&lt;/code&gt;, &lt;code&gt;fyreflock_game_move&lt;/code&gt;, &lt;code&gt;fyreflock_game_board&lt;/code&gt; and a few more. The person says "4", the model calls the move tool, and the server applies it.&lt;/p&gt;

&lt;p&gt;Which means one process now holds both seats. If it hands Claude the raw Would You Rather state, Claude knows the other person's pick before it asks you for yours. There's no clever attack in that. The model just reads the JSON.&lt;/p&gt;

&lt;p&gt;So the server became the referee. &lt;code&gt;GameSession&lt;/code&gt; owns the one true state per conversation, applies moves through the same &lt;code&gt;ingestMove&lt;/code&gt; the browsers use, and gives each seat its own view and nothing else:&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;// apps/server/src/gamesession.ts&lt;/span&gt;
&lt;span class="cm"&gt;/** What this seat is allowed to know. Never the raw state. */&lt;/span&gt;
&lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Seat&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;unknown&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;game&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="nx"&gt;unknown&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="nx"&gt;AgentGame&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;unknown&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;unknown&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seat&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;redact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seat&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;Games live in memory and die with the conversation. A restart can't leave a half-played board that nobody recalls starting, which I think is the correct way to lose data.&lt;/p&gt;

&lt;p&gt;Here's one move from a text assistant:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;sequenceDiagram
    participant P as Person A
    participant M as A's assistant
    participant S as Fyreflock server
    participant G as GameSession
    participant B as Person B
    P-&amp;gt;&amp;gt;M: 4
    Note over M: Claude Code only, a hook checks the move is what P typed
    M-&amp;gt;&amp;gt;S: fyreflock_game_move with move 4
    S-&amp;gt;&amp;gt;S: screen the text, rate limit
    S-&amp;gt;&amp;gt;G: play seat 0, input 4
    G-&amp;gt;&amp;gt;G: parse, then ingestMove inside the queue
    G--&amp;gt;&amp;gt;S: ok, new state
    S-&amp;gt;&amp;gt;B: game.moved, or game.state if B has a box
    S--&amp;gt;&amp;gt;M: text board and redacted state for seat 0, in an envelope
    M--&amp;gt;&amp;gt;P: the board&lt;/code&gt;&lt;/pre&gt;



&lt;h2&gt;
  
  
  Redaction has to be per game
&lt;/h2&gt;

&lt;p&gt;Nothing in my state shapes says which fields are private. Between browsers nothing had to, since a peer only ever received what the other peer chose to send. A generic redactor would have to guess, and guessing wrong here means telling somebody the answer.&lt;/p&gt;

&lt;p&gt;So each text-playable game got its own. Would You Rather shows the whole idea:&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;// packages/shared/src/games/agent.ts&lt;/span&gt;
&lt;span class="nf"&gt;redact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seat&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="nx"&gt;both&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;picks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;picks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&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="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="na"&gt;round&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;round&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="na"&gt;your_pick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;picks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;seat&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="p"&gt;?&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;picks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;seat&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="kr"&gt;number&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="c1"&gt;// Only once the card is face up. Before that it is the answer.&lt;/span&gt;
    &lt;span class="na"&gt;their_pick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;both&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;picks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;other&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seat&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="kr"&gt;number&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="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;agreed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;agreed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;done&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 Truths and a Lie hides the lie from the setter's own payload too. You obviously know which of your statements is false. Your model would also know, and it would happily repeat it into a conversation the other person is reading.&lt;/p&gt;

&lt;p&gt;Pig was a fun one. Its dice come from the seed, so whoever holds the seed can read the next roll before deciding whether to hold. Between browsers that was harmless. Once the server rolls and the client only watches, the seed has to go:&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;// packages/shared/src/games/agent.ts&lt;/span&gt;
&lt;span class="nx"&gt;board&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&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="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;_seed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;rest&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;rest&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 more MCP details bit here. Hosts pass &lt;code&gt;structuredContent&lt;/code&gt; to the model, so the redacted object is the only thing that ever goes in it, and the readable board goes in &lt;code&gt;content&lt;/code&gt;. And that board gets wrapped in the same envelope as a chat line, because Two Truths statements and Word Chain words are text a stranger typed, which makes them a prompt injection channel with a game skin on it. For the same reason the 400-character &lt;code&gt;move&lt;/code&gt; argument goes through the outbound screen like any message. 400 characters is plenty of room for a phone number or an API key.&lt;/p&gt;

&lt;h2&gt;
  
  
  The salt can't live in a transcript
&lt;/h2&gt;

&lt;p&gt;Two Truths commits to which statement is false and reveals it after the guess, so a modified client can't pick whichever one it wasn't caught on. Between browsers each side keeps its own salt.&lt;/p&gt;

&lt;p&gt;A model can't keep a secret from its own transcript. The salt would sit right next to the answer it's meant to hide. So the server keeps the salt, makes the commitment for the player, and produces the reveal when the game's phase asks for it. The hash check still runs and still rejects a reveal that doesn't match. Only the custody moved.&lt;/p&gt;

&lt;p&gt;The lie itself arrives as its own tool argument, never inside the move text:&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;// apps/server/src/mcp/tools.ts&lt;/span&gt;
&lt;span class="nx"&gt;inputSchema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;conversation_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&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="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;optional&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&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="mi"&gt;1&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;400&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="c1"&gt;// Two Truths only. A separate argument rather than part of the move text because&lt;/span&gt;
  &lt;span class="c1"&gt;// it must never travel back to the model, and anything inside `move` is echoed.&lt;/span&gt;
  &lt;span class="nx"&gt;lie_index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;number&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;int&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="mi"&gt;1&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;3&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;optional&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="nx"&gt;person_asked&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;personAsked&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;
  
  
  Two assistants answer at once, every time
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ingestMove&lt;/code&gt; is async. Two moves landing close together could both read the same state, both pass the checks against it, and both reduce from it, with the second quietly overwriting the first. With people clicking boards that's rare. With two models firing tool calls it's the normal case, since neither of them is waiting to watch a board redraw.&lt;/p&gt;

&lt;p&gt;So every state change goes through a promise chain:&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;// apps/server/src/gamesession.ts&lt;/span&gt;
&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;serialise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;work&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="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;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="nx"&gt;T&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="nx"&gt;run&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;work&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// Chained on the settled result so one rejection cannot wedge the queue.&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;undefined&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="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first version only routed &lt;code&gt;play&lt;/code&gt; through it. The bot's turn and the Two Truths setter wrote &lt;code&gt;this.state&lt;/code&gt; on their own, after their own awaits, while the queue's comment promised it protected the state. Good comment. Wrong code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then the chat box showed up and the model left the path
&lt;/h2&gt;

&lt;p&gt;Later the connector grew an MCP Apps widget, a small chat box drawn inside the conversation. Hosts unload that iframe whenever you look at another chat, and a WebRTC connection dies with it, so since commit &lt;code&gt;ac0a5aa&lt;/code&gt; every match with a box in it is relayed through the server:&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;// apps/server/src/hub.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;relay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;kindA&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;agent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;kindB&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;agent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;boxed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;aId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;kindA&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;boxed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;kindB&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No data channel means the lockstep engine had nothing to ride. But the referee already existed, so it moved onto the box's WebSocket: five socket messages that mirror the tools, each ending in a &lt;code&gt;game.state&lt;/code&gt; to every seat holding a box. In the box, the model never touches a move. It only gets a one-line note about the game, so "how's the game going?" still has an answer.&lt;/p&gt;

&lt;p&gt;Four ways in, one referee:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    T[Text assistant, no widget] --&amp;gt;|fyreflock_game_move| D
    W[Chat box on its WebSocket] --&amp;gt;|game.move| D
    F[Chat box whose host refused the socket] --&amp;gt;|fyreflock_app_game| D
    R[fyreflock.com tab in a relayed chat] --&amp;gt;|game.move| D
    D[GameDesk finds the session] --&amp;gt; Q[GameSession queue]
    Q --&amp;gt; I[ingestMove checks legality and commits, then reduces]
    I --&amp;gt; V[render and redact for a model]
    I --&amp;gt; X[board for a box]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The box draws your own move before the server answers, keyed on the state it was made from. The next board from the server is a new object, so the guess drops away by itself:&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;// apps/web/src/lib/relayGame.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;shown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;live&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;local&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;live&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;live&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="nl"&gt;play&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;def&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;live&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;shown&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;def&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isLegal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;shown&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;live&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;seat&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setLocal&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;live&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;next&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;def&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;shown&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;move&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;live&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;seat&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;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;t&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;game.move&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;move&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And when the referee says no, the hub sends the true board straight after the refusal, so a box that drew the move early takes it back. The socket also got the rate limit the tool path already had: 60 moves per 10 seconds per person.&lt;/p&gt;

&lt;p&gt;Why bother with the socket when a tool call works? The host probe I ran on 2026-10-19 measured both from inside the iframe:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnm3i6k0z0khxtm65b2m8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnm3i6k0z0khxtm65b2m8.png" alt="Dot plot of two ways to reach the server from inside the chat box. On Claude Desktop, claude.ai and ChatGPT the WebSocket answers in about 270 to 283 ms, while an app-initiated tools/call takes 700 to 1116 ms. In VS Code the tools/call is about 100 ms because its proxy is local." width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On Claude and ChatGPT the socket answers in 270 to 283 ms and the host-proxied tool call takes 700 to 1116 ms. VS Code is the odd one out at about 100 ms, because its proxy runs locally. On loopback, a move reached the other box in 4 ms. Your own move costs nothing to see either way, thanks to the optimistic draw.&lt;/p&gt;

&lt;p&gt;The box plays all 25 turn-based games, while the text tools offer 5, because only those have a board you can read as characters. The three realtime games need a data channel and stay on the website. The games with a secret play in the box exactly as they do in a browser, salt held on the client. One catch: that secret lives in the box instance, so if the host reloads the box mid-game, the salt is gone and the game ends with a note. A perfect-information game just gets its board handed back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Twenty-one green tests and a game nobody could start
&lt;/h2&gt;

&lt;p&gt;The first commit of all this had twenty-one passing tests. A review the same morning found that nothing about two-player games actually worked, and the review was right.&lt;/p&gt;

&lt;p&gt;The invitation reached nobody. The function that drains a player's mailbox handled seven message types and silently threw away &lt;code&gt;game.invite&lt;/code&gt; and &lt;code&gt;game.moved&lt;/code&gt;, under a comment saying anything else was reported rather than dropped.&lt;/p&gt;

&lt;p&gt;Two Truths was registered, listed and invitable, and its parser returned &lt;code&gt;null&lt;/code&gt; for every input, so each move came back "illegal" with a hint telling the model to retry the one thing that could never work. The loser never saw the end, because the session was torn down inside the winner's call, so their next move was answered with "there is no game running". A person playing the computer while they waited, who then matched and accepted a real game, had their next move land on the bot's board while the stranger stared at an empty one.&lt;/p&gt;

&lt;p&gt;And any third account could end two other people's game, because quitting checked that a game existed instead of checking that you were in it.&lt;/p&gt;

&lt;p&gt;My favourite: the bot test asserted &lt;code&gt;solo === true&lt;/code&gt; on a session it had just built with a null second seat. It tested that I can type.&lt;/p&gt;

&lt;p&gt;The fix was 657 inserted lines across 10 files, including a new 263-line test file covering the layer where four of these were hiding: the mailbox, the board, move routing, and who's allowed to end a game. The units were fine. The thing between them was broken.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;I'd mark private fields in the state types from day one. "Secret by not sending it" was a perfectly good rule for two peers, and it left me with zero information about what to hide once one process held everything. Every redactor was written by reading a reducer and asking "would this spoil the game?"&lt;/p&gt;

&lt;p&gt;I'd also write the first test as a whole conversation: two accounts, an invite, an accept, some moves, a finish both sides can see. That's roughly what the 263-line file became, written after the review instead of before it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part I still can't enforce everywhere
&lt;/h2&gt;

&lt;p&gt;The server stops illegal moves and hides secrets. What it can't do on its own is stop a model from playing a perfectly legal move its person never chose.&lt;/p&gt;

&lt;p&gt;In Claude Code it's enforced. The plugin has a &lt;code&gt;PreToolUse&lt;/code&gt; hook on the move tool that compares the move with what you typed, and the rule is equality. Its first rule was "is the sent text somewhere in what they typed", and a review found fifteen ways through that in one sitting. Typing &lt;code&gt;4&lt;/code&gt; works, &lt;code&gt;tell them 4&lt;/code&gt; works, and &lt;code&gt;column 4 please&lt;/code&gt; gets refused. On claude.ai and ChatGPT there are no hooks, so the rule is one sentence in the tool description: "they are playing, not you". The box sidesteps the whole thing by keeping the model out of the move path, and the text tools are still there for hosts that can't draw it.&lt;/p&gt;

&lt;p&gt;So here's what I keep going back and forth on. If your MCP tool acts for one person against another, would you enforce the exact words and annoy everyone who types like a human, or let the model paraphrase and accept that some day it plays a move nobody picked?&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Get a weekly list of your competitor's new Google ads</title>
      <dc:creator>Ayush Mishra</dc:creator>
      <pubDate>Wed, 28 Oct 2026 18:54:21 +0000</pubDate>
      <link>https://dev.to/fuloxdev/get-a-weekly-list-of-your-competitors-new-google-ads-43l0</link>
      <guid>https://dev.to/fuloxdev/get-a-weekly-list-of-your-competitors-new-google-ads-43l0</guid>
      <description>&lt;p&gt;Google's Ads Transparency Center shows every ad an advertiser runs, but one advertiser at a time and with no export. Here is how to get a weekly list of only the new ones with an Apify Actor I built: &lt;a href="https://apify.com/fulox/google-ads-transparency-scraper" rel="noopener noreferrer"&gt;Google Ads Transparency Scraper&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Enter advertisers
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;advertisers&lt;/code&gt;, type a name, a domain or a Google advertiser id (&lt;code&gt;AR&lt;/code&gt; plus 20 digits), up to 50. Names and domains resolve to the advertiser with the most ads; the other matches are listed in the free &lt;code&gt;advertiser&lt;/code&gt; row under &lt;code&gt;alternatives&lt;/code&gt;. If the match is wrong, copy the id from there and run again.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. First run
&lt;/h2&gt;

&lt;p&gt;Set &lt;code&gt;maxAdsPerAdvertiser&lt;/code&gt; (default 40, up to 2,000) and click Start. Each ad is one row: &lt;code&gt;format&lt;/code&gt;, &lt;code&gt;firstShown&lt;/code&gt;, &lt;code&gt;lastShown&lt;/code&gt;, &lt;code&gt;imageUrl&lt;/code&gt; or &lt;code&gt;previewUrl&lt;/code&gt;, and &lt;code&gt;adUrl&lt;/code&gt;, which opens the ad on the Transparency Center. The default run costs $0.056. With &lt;code&gt;onlyNewSinceLastRun&lt;/code&gt; on, this first run is the baseline: all fetched ads are returned, flagged &lt;code&gt;isNew&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Weekly runs
&lt;/h2&gt;

&lt;p&gt;Turn on &lt;code&gt;onlyNewSinceLastRun&lt;/code&gt; and schedule the Actor weekly. Now each run returns only ads first seen since your last run. The memory is a named key-value store in your own account; &lt;code&gt;resetState&lt;/code&gt; starts over. A quiet week costs nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Send it somewhere
&lt;/h2&gt;

&lt;p&gt;In the Integrations tab connect Google Sheets, or use Make, Zapier or n8n, and filter rows to &lt;code&gt;type&lt;/code&gt; = &lt;code&gt;ad&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;p&gt;Google does not list ads newest first, and new-only compares the first &lt;code&gt;maxAdsPerAdvertiser&lt;/code&gt; ads it returns, so for a large advertiser raise the limit. There are no region or date filters yet, and video ads come out as &lt;code&gt;unknown&lt;/code&gt; format. The price is $1.40 per 1,000 ads; lookups, empty results and failed requests are free. Not affiliated with Google.&lt;/p&gt;

</description>
      <category>apify</category>
      <category>sales</category>
      <category>automation</category>
      <category>data</category>
    </item>
  </channel>
</rss>
