fix(host): a followed automation that is deleted is told not found at once

Merged
CH
12d ago
+92-12

Follow-up to #3297, from Devin's review there, which came in after it merged.

What was wrong

When an automation's runs were being followed and the automation was deleted (or became unreadable), the next renewal or poll came back not-found. liveRows ended the follow as gone, but automation-follow.ts caught that, waited 5 s, and started again. So the page kept showing the old runs for 5 s before it was told not-found.

Change

followed now checks why liveRows ended. On LIVE_GONE it ends the follow at once:

  • If the last renewal or poll failed as not-found, the page is told not-found.
  • If the session signed out, the follow ends without telling the page anything.

This is the same handling #3276 gave the task list follow.

Checks

  • New composer test: a runs follow whose next poll comes back not-found tells the page at once and asks nothing more. It fails without the fix.
  • compose-automations.test.ts passes (7); typecheck, biome and the repo lint are clean.

Made with Luke


Devin Review