Skip to content

fix(panel): a write's late answer draws nothing over a list pushed since it was sent - #4343

Merged
luke-agent[bot] merged 3 commits into
mainfrom
luke/automations-late-write
Oct 21, 2026
Merged

luke-agent[bot] merged 3 commits into
mainfrom
luke/automations-late-write

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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

What was wrong

Since #3297, the Automations list is pushed by the host and isn't read again after a write. A write's answer still lands in the list at once, but nothing compared it with the pushes. So a slow answer could overwrite a newer push and stay there. For example: window A toggles an automation off and its answer is slow; window B turns it on; A gets the push showing On, then A's late Off answer lands and shows Off.

Change

useAutomations counts the lists it's pushed. A write on an automation the list already holds (change, toggle, delete, new secret) lands its answer only if no push arrived after it was sent. A create's answer always lands, because its page opens on it. It's added only if no push has already carried the new automation (from Devin's review here). Dropping the answer loses nothing: if that push came from before the write committed, the commit itself is pushed next, within about a second.

Checks

  • New page tests: a push arriving before a held create still opens the created automation, and a switch whose answer arrives after a push (another window renamed the automation) leaves the pushed list as it is. It fails without the fix.
  • automations-page.test.ts passes (86); panel typecheck and biome are clean.

Made with Luke


Devin Review

View guided diff Turn on auto-fix

…nce it was sent

Since #3297 nothing reads the list again after a write, so a write's answer
that landed after a newer push stood over it. The Automations list now counts
the pushes it takes and lands a write's answer only where none came since the
write was sent; the write's own commit is pushed after it in any case.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
luke-web Ready Ready Preview Oct 21, 2026 6:27am UTC

Request Review

@luke-agent
luke-agent Bot enabled auto-merge October 21, 2026 06:18
devin-ai-integration[bot]

This comment was marked as resolved.

@luke-agent
luke-agent Bot disabled auto-merge October 21, 2026 06:20
… push carried it

A create's page opens on the automation it answers, so dropping that answer
after an unrelated push left the editor on an automation the list did not
hold yet, its draft and once-only webhook secret lost. Creates now always
land, added only where no push carried the automation already.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot enabled auto-merge October 21, 2026 06:22
devin-ai-integration[bot]

This comment was marked as resolved.

@luke-agent
luke-agent Bot disabled auto-merge October 21, 2026 06:24
…y its answer

The list remembers every automation a push carried, and a create's answer
adds the automation only where none did, so one another window deleted
before the answer landed stays deleted.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot enabled auto-merge October 21, 2026 06:24
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 70d7cda Oct 21, 2026
12 checks passed
@luke-agent
luke-agent Bot deleted the luke/automations-late-write branch October 21, 2026 06:34

This branch was successfully deployed

1 active deployment
Preview — 3a1544a4 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant