Skip to content

feat(apps): poll deployments so the page follows the lifecycle - #72

Merged
v0l merged 1 commit into
mainfrom
feat/poll-deployments
Jul 28, 2026
Merged

feat(apps): poll deployments so the page follows the lifecycle#72
v0l merged 1 commit into
mainfrom
feat/poll-deployments

Conversation

@v0l

@v0l v0l commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Closes #71.

A deployment moves through payment → deploying → running without the customer touching anything, and both surfaces rendered whatever the API said when the page loaded. Paying a subscription in another tab left Needs payment on screen until a manual reload.

A 5s setInterval, cleared on unmount, on each surface — the same shape as the two that already exist for VMs (vm.tsx:108-110, account.tsx:32):

  • account-app-deployment.tsx refetches the deployment. Not the catalog app alongside it, which does not change while the page is open.
  • account-apps.tsx refetches the deployment list. Not listApps(), same reason.

Both feed deploymentLifecycle(), so the banner, the pill and the section gates re-derive together — polling the raw status would put back exactly what #69/#70 removed.

Poll failures are dropped, deliberately, in two places. This runs every five seconds against a page someone is reading: one dropped request should not paint an error over data that is still on screen, and the next tick recovers. On the list it also must not fall back to [] the way the initial load does — an empty list reads as "you have no apps", a worse lie than a slightly stale row. The initial load still surfaces its own failure on both pages.

Known and accepted: a poll landing between a Stop/Start click and the operator's write-back can briefly show the old state, so the button appears to flip back before settling. Inherent to polling, self-corrects within one tick; the VM page has behaved this way since it shipped.

Checks

Verified in headless Chrome against a stub that can flip a fixture mid-session:

/account/apps/deployments/3  DEPLOYING → RUNNING within 7s, same document
/account/apps  row 1         NEEDS PAYMENT → RUNNING within 7s, same document
navigate away to /           0 deployment requests in the next 7s

The "same document" checks read a marker set on window before the flip, so a reload would fail them rather than pass for the wrong reason. On 0b56b69 both labels stay stale, which is the bug.

bunx tsc --noEmit clean and bun run build exit 0, both re-run at 92c2b99. prettier --check passes on both files. No new strings, so no locale work. Commit unsigned (--no-gpg-sign): no pinentry TTY here.

Originating channel: lnvps (f5894ea9-44c7-56fb-bd9b-6e3e671e4bc1).

Closes #71.

A deployment moves through payment → deploying → running without the customer
touching anything, and both surfaces rendered whatever the API said when the
page loaded. Paying a subscription in another tab left "Needs payment" on
screen until a manual reload.

A 5s `setInterval`, cleared on unmount, on each surface — the same shape as the
two that already exist for VMs (`vm.tsx:108-110`, `account.tsx:32`):

- `account-app-deployment.tsx` refetches the deployment. Not the catalog app
  alongside it, which does not change while the page is open.
- `account-apps.tsx` refetches the deployment list. Not `listApps()`, same
  reason.

Both feed `deploymentLifecycle()`, so the banner, the pill and the section
gates re-derive together — polling the raw `status` would put back exactly what
web#69/#70 removed.

**Poll failures are dropped, and that is deliberate in two places.** This runs
every five seconds against a page someone is reading: one dropped request
should not paint an error over data that is still on screen, and the next tick
recovers. On the list it also must not fall back to `[]` the way the initial
load does — an empty list reads as "you have no apps", which is a worse lie
than a slightly stale row. The initial load still surfaces its own failure on
both pages.

Known and accepted: a poll landing between a Stop/Start click and the
operator's write-back can briefly show the old state, so the button appears to
flip back before settling. Inherent to polling and self-correcting within one
tick; the VM page has behaved this way since it shipped.

Verified in headless Chrome against a stub that can flip a fixture mid-session:

    /account/apps/deployments/3  DEPLOYING → RUNNING within 7s, same document
    /account/apps  row 1         NEEDS PAYMENT → RUNNING within 7s, same document
    navigate away to /           0 deployment requests in the next 7s

The "same document" checks read a marker set on `window` before the flip, so a
reload would fail them rather than pass for the wrong reason. On `0b56b69` both
labels stay stale, which is the bug.

`bunx tsc --noEmit` clean, `bun run build` exit 0, `prettier --check` passes on
both files. No new strings.

Signed-off-by: Kieran <kieran@harkin.me>
@v0l
v0l merged commit b5832c5 into main Jul 28, 2026
3 checks passed
@v0l
v0l deleted the feat/poll-deployments branch July 29, 2026 11:38
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.

Poll deployments

1 participant