Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions apps/web/e2e/QUARANTINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,3 +590,32 @@ no such part beyond the wrong notification).
visitors see "All systems operational". Fix: derive it from the anonymous
projection (`getStatusPageSnapshot(ANONYMOUS_ACTOR, …).topLevel`), or relabel
the banner. owner: unassigned, review by: 2026-12-03.
- `status/public-page.spec.ts` › STA-P-15 uptime follows a status that has no
history row. `createStatusComponent`
(`apps/web/src/lib/server/domains/status/status.components.ts:176`) stores a
non-operational initial status (REST and the server fn accept one) without a
`status_component_events` row or a `status.component_changed` event, and the
uptime derivation starts from operational when a service has no event
(`status.public.ts:291`), so a service created "Major outage" shows a 100%
operational bar. Fix: write the initial event (and the webhook event) when the
create status is not operational. owner: unassigned, review by: 2026-12-03.
- `status/subscribe.spec.ts` › STA-S-09 a component subscription with no or
unknown services is refused. `subscribeStatusFn`
(`apps/web/src/lib/server/functions/status-subscriptions.ts:25`) takes
`scope: 'components'` with an empty or non-existent `componentIds` and stores
an active subscription that can never match an incident (it still counts as
a subscriber and takes a plan slot). The portal UI prevents both. Fix: refuse
an empty list and ids that are not live, visible services. owner:
unassigned, review by: 2026-12-03.
- `status/emails.spec.ts` › STA-S-23 nothing is emailed for an incident or
window created already over. Same cause as STA-A-30
(`status.service.ts:242`, `:317`): subscribers get "New incident reported …
Resolved". owner: unassigned, review by: 2026-12-03.
- `status/emails.spec.ts` › STA-S-30 an incident cannot be pinned to the
"maintenance" impact. The REST validator
(`apps/web/src/routes/api/v1/status/-validation.ts:33`) and the server fn
accept `impact: 'maintenance'` on `kind: 'incident'`, and the incident email
(`packages/email/src/templates/status-incident-published.tsx:29`) has no
colour or label for it, so its impact bar reads " · Investigating". Fix:
refuse it for incidents (or give the template a Maintenance label). owner:
unassigned, review by: 2026-12-03.
25 changes: 22 additions & 3 deletions apps/web/e2e/product/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,23 @@ export async function createIncident(
api: APIRequestContext,
input: IncidentInput
): Promise<AdminIncident> {
return must<AdminIncident>(api, 'createStatusIncidentFn', incidentPayload(input))
const incident = await must<AdminIncident>(api, 'createStatusIncidentFn', incidentPayload(input))
made.add(incident.id)
return incident
}

/** Incidents and windows made by createIncident in this worker since the last cleanup. */
const made = new Set<string>()

/**
* Delete what this test's helpers created. The feed keeps every open
* incident's newest entry within its 50-item cap, so open incidents left
* behind would crowd later tests' items out of it. Call in afterEach.
*/
export async function deleteMadeIncidents(api: APIRequestContext): Promise<void> {
const ids = [...made]
made.clear()
for (const id of ids) await callServerFn(api, 'deleteStatusIncidentFn', { id })
}

/** The same call, without failing: for refusals. */
Expand Down Expand Up @@ -388,10 +404,13 @@ export interface PortalUser extends MintedCustomer {
export async function mintPortalUser(
playwright: PlaywrightWorkerArgs['playwright'],
marker: string,
label = 'sub'
label = 'sub',
opts: { anonymous?: boolean } = {}
): Promise<PortalUser> {
const email = `${marker}-${label}-${Math.random().toString(36).slice(2, 7)}@customers.example`
const customer = await mintCustomer({ email, name: `Sub ${label} ${marker.slice(-6)}` })
const customer = opts.anonymous
? await mintCustomer({ anonymous: true })
: await mintCustomer({ email, name: `Sub ${label} ${marker.slice(-6)}` })
const env = supportEnv()
const token = await mintSessionToken(customer.userUuid)
const signature = createHmac('sha256', env.app.SECRET_KEY).update(token).digest('base64')
Expand Down
2 changes: 2 additions & 0 deletions apps/web/e2e/tests/status/admin-incidents.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
serviceRow,
setServiceStatus,
tryCreateIncident,
deleteMadeIncidents,
} from '../../product/status'

// Browser journeys share the machine with the app under load: allow a minute.
Expand All @@ -47,6 +48,7 @@ test.beforeEach(async ({ playwright }) => {
admin = await personApi(playwright, 'admin')
})
test.afterEach(async () => {
await deleteMadeIncidents(admin)
await admin.dispose()
})

Expand Down
2 changes: 2 additions & 0 deletions apps/web/e2e/tests/status/admin-maintenance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
serviceRow,
toggleService,
tryCreateIncident,
deleteMadeIncidents,
} from '../../product/status'

test.describe.configure({ timeout: 60_000 })
Expand All @@ -44,6 +45,7 @@ test.beforeEach(async ({ playwright }) => {
admin = await personApi(playwright, 'admin')
})
test.afterEach(async () => {
await deleteMadeIncidents(admin)
await admin.dispose()
})

Expand Down
2 changes: 2 additions & 0 deletions apps/web/e2e/tests/status/admin-services.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
serviceEvents,
serviceRow,
setServiceStatus,
deleteMadeIncidents,
} from '../../product/status'

test.describe.configure({ timeout: 60_000 })
Expand All @@ -37,6 +38,7 @@ test.beforeEach(async ({ playwright }) => {
admin = await personApi(playwright, 'admin')
})
test.afterEach(async () => {
await deleteMadeIncidents(admin)
await admin.dispose()
})

Expand Down
2 changes: 2 additions & 0 deletions apps/web/e2e/tests/status/admin-templates.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
must,
openAdmin,
searchList,
deleteMadeIncidents,
} from '../../product/status'

test.describe.configure({ timeout: 60_000 })
Expand All @@ -30,6 +31,7 @@ test.beforeEach(async ({ playwright }) => {
admin = await personApi(playwright, 'admin')
})
test.afterEach(async () => {
await deleteMadeIncidents(admin)
await admin.dispose()
})

Expand Down
Loading
Loading