Skip to content

fix(seed): give seeded applications a submitted_at, and make the smoke wait for a rendered frame (#966) - #971

Closed
thinkclay wants to merge 3 commits into
mainfrom
fix/966-seed-submitted-at
Closed

thinkclay wants to merge 3 commits into
mainfrom
fix/966-seed-submitted-at

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Closes #966. Two commits: the seed fix, and the harness fix that the dark pass made necessary.

1. Seeded applications have no submitted_at, so the local pipeline was empty

Since #905, routes/employer-applications.ts:286 lists only rows where submitted_at IS NOT NULL. Migration 359 backfills the column — but on pnpm supa db reset migrations run before seeds, so the backfill meets an empty table, and 006_seed-unicorn-ats.sql / 008_seed-cross-org-demo.sql then insert sixteen applications without it. Every local stack since has shown the seeded office user "0 applications" in every stage while the rows sat in core.applications.

017_seed-application-submitted-at.sql applies 359's exact expression after the inserts. A trailing seed rather than edits to six INSERT blocks, so the next seed that forgets the column is covered too.

Proven on a fresh stack, not on the database I had hand-patched: after pnpm supa db reset, count(*) where submitted_at is null = 0, and GET /v1/employer/applications as [email protected] returns 12 rows (was 0).

2. The smoke captured spinners and half-themed frames while reporting success

smoke-authed.mjs waited for networkidle + 5 s and then screenshotted — but it read <html data-theme> for its theme assertion after the screenshots. On a cold Metro bundle the first dark run produced a white "Loading…" overlay on one route and a half-themed frame on another, while the assertion said dark for every route and the pass exited 0. A green pass with a wrong picture is exactly what that assertion was added to prevent.

It now waits (up to 45 s) for data-theme to be stamped and for the overlay text to be gone, settles 2.5 s, and says so per route if it gives up.

What the restored pass found

With the stack back (Docker was simply not running on 2 Oct) the dark pass runs end to end — 8/8 routes theme: dark, 12 captures — and its findings are filed, all milestoned to v1.22.0:

Verification

  • pnpm prepush green, and with the local stack up it ran the 19 gated HTTP suites for real: 163 passed, 0 failed — the first live run this week.
  • Light pass: 8/8 routes, 12 captures, pipeline populated. Dark pass: 8/8 theme: dark, 12 captures.
  • migration numbers unique (198), ratchet within baseline.

🤖 Generated with Claude Code

thinkclay and others added 3 commits October 5, 2026 07:56
…ine is not empty (#966)

Closes #966.

Since 359_application_submitted_at.sql (#905), routes/employer-applications.ts
lists only rows where submitted_at IS NOT NULL. 359 backfills the column, but
on a local reset migrations run before seeds, so the backfill meets an empty
table and seeds 006 and 008 then insert sixteen applications without it. Every
local stack since has shown the seeded office user "0 applications" in every
stage while the rows sat in core.applications.

Measured with the seeded user's token: GET /v1/employer/applications returned
0 rows; after the same UPDATE on the local database, 12 — the whole Unicorn
pipeline across eight stages.

A trailing seed applying 359's exact expression after the inserts, rather than
edits to six INSERT blocks, so the next seed that forgets the column is covered
too.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…apturing

`networkidle` is not "rendered". After the network goes quiet the app still has
its own gates: the theme resolves from storage and InnerProvider stamps
<html data-theme>, and the protected layout holds a "Loading..." overlay until
the session and prerequisites settle. On a cold Metro bundle both outlast the
fixed 5s wait the smoke used.

The first dark run (#833) showed what that costs: one route captured a white
"Loading..." overlay, and another a half-themed frame — while the data-theme
assertion, read AFTER the screenshots, said "dark" for every route and the pass
exited 0. A green pass with a wrong picture is the exact failure the assertion
was added to prevent.

Now waits (up to 45s) for data-theme to be stamped and for the overlay text to
be gone, then settles 2.5s, and says so per route if it gave up.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The REST API Tests workflow triggers on functions/api, migrations, tests and
types.ts — not seeds. The gated suites read seeded state (the office user, the
Unicorn org and its jobs), so a seed change can alter what they see, and #966
went through every check with that workflow never running. It had passed
locally (163/0), which is not the same thing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Results


@thinkclay

Copy link
Copy Markdown
Contributor Author

Closing: the seed and the seeds/** trigger landed first in #972 (same file name, same fix), and the remaining commit conflicted with #987/#995/#997 on api-tests.yml. The harness fix is re-landed alone as #998.

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.

Seeded applications have no submitted_at, so the local employer pipeline is empty since #905

1 participant