mint-invite: members rows:null (Go nil slice) crashes the Members surface — GOTCHA #269 #1641

Closed
opened 2026-09-19 23:28:01 +00:00 by matou-build-agent · 2 comments

Verdict

verdict.json — 19 legs, 18 green, 1 red, "firstRedLeg": "mint-invite", commit 3e8311cd (= repo HEAD). Everything through oidc-admin passed, including the 889 s deploy-takeover.

This is NOT the known frontier. The brief names pairing-never-flips (the own-VPS carrier issue) as this drive's known red, but legs.json records {"leg": "pair", "status": "green", "ms": 3966} and "skip": 0 — there are no skipped legs and no skip reasons in this run at all. The frontier did not fire; this is a new, separate red.

The live box at 134.199.150.105 was reachable and answered every read-only probe (systemctl --failed returned nothing; ss -tlnp shows caddy on 443, control-plane on 8080, idss-idp on 8465). Nothing is down — this is a pure render fault.

The failure

legs.json / journey.json, the mint-invite leg:

"error": "the IDIP roster panel must compose on the IDIP path\n\nexpect(locator).toBeVisible() failed\n\nLocator: locator('[data-status=\"idip-roster\"]')\nExpected: visible\nTimeout: 30000ms\nError: element(s) not found"

The selector is not slow — it never exists. error-context.md shows why: the Members surface rendered its error boundary, not its content:

- navigation:
  - button "Overview"
  - button "Fleet"
  - button "Services"
  - button "Members"
  ...
- alert:
  - paragraph: This view hit a display fault. The fleet itself is unaffected — this is a display failure, not a service failure.
  - button "Reload this view"

The chrome and tab strip are fine; the whole surface below them is gone. That string is dashboard/src/components/SurfaceErrorBoundary.vue:37.

The throw

trace.zip → 2-trace.trace carries the real fault on the console, twice:

[dashboard] surface display fault TypeError: Cannot read properties of null (reading 'length')
    at Proxy.<anonymous> (https://rehearsal-f.idss.nz/assets/index-DVoP64yT.js:144:9646)

[dashboard] surface display fault TypeError: Cannot read properties of null (reading 'filter')
    at b_.fn (https://rehearsal-f.idss.nz/assets/index-DVoP64yT.js:144:213941)

The null is on the wire. The trace's captured response body for GET /api/v1/members (200, sha 904f1522…) is:

{"rows":null,"invite_panel_prominent":true}

and the live box reproduces it byte-for-byte right now:

# curl -sS http://127.0.0.1:8080/api/v1/members
{"rows":null,"invite_panel_prominent":true}

The roster data itself is healthy — GET /api/v1/idip/roster on the same box returns a real member:

[{"aid":"EB1u3PTQ2_GfcAZ9yZMZxjLZsJbBlJP3uDXRtwGNppnt","username":"drive","name":"Drive Operator","role":"operator","status":"active"}]

and the droplet journal confirms it registered cleanly:

23:19:50 idss-control-plane-start[4265]: level=INFO msg="idip roster: founder registered" aid=EB1u3PTQ2… role=operator

The defect

Three links, all verified in-tree at the drive's commit:

  1. Producer. internal/member/member.go:181-201 — Orchestrator.Members() does view := MembersView{} then view.Rows = append(view.Rows, row) per ledger member. With zero non-removed members, Rows stays a nil slice, and encoding/json writes nil slices as null, never []. Rows []Row \json:"rows"`(member.go:51) has noomitempty, so the key ships as an explicit null`.

  2. Contract. dashboard/src/lib/api/generated.ts:1000 declares rows: MemberRow[] — non-nullable and required. The server is violating its own generated view type.

  3. Consumer. dashboard/src/components/members/MembersScreen.vue dereferences it unguarded — :293 props.view.rows.filter((r) => r.status === 'awaiting approval'), :329 const n = props.view.rows.length, :331 props.view.rows.filter(...).length. These are exactly the two TypeErrors in the trace (reading 'filter' at a chained computed, reading 'length' in render).

Why that kills the roster: MembersSurface.vue composes <MembersScreen> at line 65 and <IdipRosterPanel v-if="idip"> at line 74 — siblings inside one surface, MembersScreen first. Both sit under the single SurfaceErrorBoundary at DashboardComposition.vue:40. MembersScreen throws, Vue unmounts the whole subtree, and the boundary swallows the sibling roster panel with it. [data-status="idip-roster"] is therefore never in the DOM, and mintInviteInDashboard (app/tests/e2e/fixtures/idip.ts:218) burns its full 30 s ceiling on a selector that cannot appear.

Rows being empty is expected here, not a bug: the journal records member identity provider: kanidm-tier member family resting — the IDIP bridge is the identity provider on this path (IDSS_IDP_URL set, no kanidm by construction). On the IDIP path the members live on the IDIP roster, so the kanidm-tier ledger is legitimately empty. The MembersView doc-comment's invariant ("the surface is never empty — the founder is row one") holds on the kanidm path but not this one. The defect is the null encoding of that empty list plus the unguarded read, not the emptiness.

Suspected layer

Product (control-plane Go + dashboard Vue). Not harness: the locator, the 30 s ceiling and the fixture are all correct, and the assertion message is accurate about what it wanted. Not infra: no failed units, all ports listening, the roster endpoint healthy.

This is a verbatim recurrence of docs/GOTCHAS.md #269 ("A Go NIL SLICE marshals to JSON null, not [] — the Updates surface's three empty sections arrived as null, the screen read .length off one, and the whole surface fell to the display-fault boundary"), same symptom string and all. That entry's Rule — "a Go slice that crosses the wire as a LIST must be initialised empty ([]T{}), not declared nil… a TypeScript view type that says T[] is a promise the producer keeps" — was applied to updates.Orchestrator.State() but the codebase was never swept for the same append-onto-nil shape elsewhere. member.Orchestrator.Members() is the one that was missed.

What plugging it needs

  1. Initialise the list empty in internal/member/member.go:181 — view := MembersView{Rows: []Row{}} (and check Pending, which is omitempty so it is safe, plus PendingGroup.Members which is not).
  2. Add a marshalled-JSON assertion, not a Go-value one, per #269's Rule: json.Marshal(o.Members()) on an empty ledger must contain "rows":[]. Existing unit tests never caught this because they build fixtures by hand — dashboard/tests/unit/membersLive.test.ts:104 uses a literal array and never marshals, and there is no rows: null case anywhere in dashboard/tests or internal/.
  3. Null-guard the consumer as defence in depth: MembersScreen.vue:293/329/331 should read props.view.rows ?? [].
  4. Worth a sweep for the same append-onto-nil-then-marshal shape across the other control-plane orchestrators, since the Rule has now been broken twice.

Secondary, and not required to clear this leg: whether the Members surface should mirror the IDIP roster's members on the IDIP path (today it shows an empty list beside a populated roster panel) is a design question, not part of this fix.

drive 20260919T230228Z red at mint-invite: the IDIP roster panel must compose on the IDIP path expect(locator).toBeVisible() failed Locator: locator('[data-status="idip-roster"]') Expected: visible Timeout: 30000ms Error: element(s) not found
evidence: /home/swarm/session-runner/idss/test-results/drive-idip/20260919T230228Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Verdict `verdict.json` — 19 legs, 18 green, **1 red**, `"firstRedLeg": "mint-invite"`, commit `3e8311cd` (= repo HEAD). Everything through `oidc-admin` passed, including the 889 s `deploy-takeover`. **This is NOT the known frontier.** The brief names pairing-never-flips (the own-VPS carrier issue) as this drive's known red, but `legs.json` records `{"leg": "pair", "status": "green", "ms": 3966}` and `"skip": 0` — there are **no skipped legs and no skip reasons in this run at all**. The frontier did not fire; this is a new, separate red. The live box at `134.199.150.105` **was reachable** and answered every read-only probe (`systemctl --failed` returned nothing; `ss -tlnp` shows caddy on 443, control-plane on 8080, idss-idp on 8465). Nothing is down — this is a pure render fault. ## The failure `legs.json` / `journey.json`, the `mint-invite` leg: ``` "error": "the IDIP roster panel must compose on the IDIP path\n\nexpect(locator).toBeVisible() failed\n\nLocator: locator('[data-status=\"idip-roster\"]')\nExpected: visible\nTimeout: 30000ms\nError: element(s) not found" ``` The selector is not slow — it never exists. `error-context.md` shows why: the Members surface rendered its **error boundary**, not its content: ```yaml - navigation: - button "Overview" - button "Fleet" - button "Services" - button "Members" ... - alert: - paragraph: This view hit a display fault. The fleet itself is unaffected — this is a display failure, not a service failure. - button "Reload this view" ``` The chrome and tab strip are fine; the whole surface below them is gone. That string is `dashboard/src/components/SurfaceErrorBoundary.vue:37`. ## The throw `trace.zip` → `2-trace.trace` carries the real fault on the console, twice: ``` [dashboard] surface display fault TypeError: Cannot read properties of null (reading 'length') at Proxy.<anonymous> (https://rehearsal-f.idss.nz/assets/index-DVoP64yT.js:144:9646) [dashboard] surface display fault TypeError: Cannot read properties of null (reading 'filter') at b_.fn (https://rehearsal-f.idss.nz/assets/index-DVoP64yT.js:144:213941) ``` The null is on the wire. The trace's captured response body for `GET /api/v1/members` (200, sha `904f1522…`) is: ```json {"rows":null,"invite_panel_prominent":true} ``` and the **live box reproduces it byte-for-byte right now**: ``` # curl -sS http://127.0.0.1:8080/api/v1/members {"rows":null,"invite_panel_prominent":true} ``` The roster data itself is healthy — `GET /api/v1/idip/roster` on the same box returns a real member: ```json [{"aid":"EB1u3PTQ2_GfcAZ9yZMZxjLZsJbBlJP3uDXRtwGNppnt","username":"drive","name":"Drive Operator","role":"operator","status":"active"}] ``` and the droplet journal confirms it registered cleanly: ``` 23:19:50 idss-control-plane-start[4265]: level=INFO msg="idip roster: founder registered" aid=EB1u3PTQ2… role=operator ``` ## The defect Three links, all verified in-tree at the drive's commit: 1. **Producer.** `internal/member/member.go:181-201` — `Orchestrator.Members()` does `view := MembersView{}` then `view.Rows = append(view.Rows, row)` per ledger member. With zero non-removed members, `Rows` stays a **nil slice**, and `encoding/json` writes nil slices as `null`, never `[]`. `Rows []Row \`json:"rows"\`` (member.go:51) has no `omitempty`, so the key ships as an explicit `null`. 2. **Contract.** `dashboard/src/lib/api/generated.ts:1000` declares `rows: MemberRow[]` — non-nullable and required. The server is violating its own generated view type. 3. **Consumer.** `dashboard/src/components/members/MembersScreen.vue` dereferences it unguarded — `:293` `props.view.rows.filter((r) => r.status === 'awaiting approval')`, `:329` `const n = props.view.rows.length`, `:331` `props.view.rows.filter(...).length`. These are exactly the two TypeErrors in the trace (`reading 'filter'` at a chained computed, `reading 'length'` in render). **Why that kills the roster:** `MembersSurface.vue` composes `<MembersScreen>` at line 65 and `<IdipRosterPanel v-if="idip">` at line 74 — **siblings inside one surface**, MembersScreen first. Both sit under the single `SurfaceErrorBoundary` at `DashboardComposition.vue:40`. MembersScreen throws, Vue unmounts the whole subtree, and the boundary swallows the sibling roster panel with it. `[data-status="idip-roster"]` is therefore never in the DOM, and `mintInviteInDashboard` (`app/tests/e2e/fixtures/idip.ts:218`) burns its full 30 s ceiling on a selector that cannot appear. Rows being *empty* is expected here, not a bug: the journal records `member identity provider: kanidm-tier member family resting — the IDIP bridge is the identity provider on this path (IDSS_IDP_URL set, no kanidm by construction)`. On the IDIP path the members live on the IDIP roster, so the kanidm-tier ledger is legitimately empty. The MembersView doc-comment's invariant ("the surface is never empty — the founder is row one") holds on the kanidm path but not this one. The defect is the **null encoding of that empty list plus the unguarded read**, not the emptiness. ## Suspected layer **Product** (control-plane Go + dashboard Vue). Not harness: the locator, the 30 s ceiling and the fixture are all correct, and the assertion message is accurate about what it wanted. Not infra: no failed units, all ports listening, the roster endpoint healthy. This is a **verbatim recurrence of `docs/GOTCHAS.md` #269** ("A Go NIL SLICE marshals to JSON `null`, not `[]` — the Updates surface's three empty sections arrived as `null`, the screen read `.length` off one, and the whole surface fell to the display-fault boundary"), same symptom string and all. That entry's Rule — *"a Go slice that crosses the wire as a LIST must be initialised empty (`[]T{}`), not declared nil… a TypeScript view type that says `T[]` is a promise the producer keeps"* — was applied to `updates.Orchestrator.State()` but the codebase was never swept for the same append-onto-nil shape elsewhere. `member.Orchestrator.Members()` is the one that was missed. ## What plugging it needs 1. Initialise the list empty in `internal/member/member.go:181` — `view := MembersView{Rows: []Row{}}` (and check `Pending`, which is `omitempty` so it is safe, plus `PendingGroup.Members` which is not). 2. Add a marshalled-JSON assertion, not a Go-value one, per #269's Rule: `json.Marshal(o.Members())` on an empty ledger must contain `"rows":[]`. Existing unit tests never caught this because they build fixtures by hand — `dashboard/tests/unit/membersLive.test.ts:104` uses a literal array and never marshals, and there is no `rows: null` case anywhere in `dashboard/tests` or `internal/`. 3. Null-guard the consumer as defence in depth: `MembersScreen.vue:293/329/331` should read `props.view.rows ?? []`. 4. Worth a sweep for the same append-onto-nil-then-marshal shape across the other control-plane orchestrators, since the Rule has now been broken twice. Secondary, and **not** required to clear this leg: whether the Members surface should mirror the IDIP roster's members on the IDIP path (today it shows an empty list beside a populated roster panel) is a design question, not part of this fix. drive `20260919T230228Z` red at `mint-invite`: `the IDIP roster panel must compose on the IDIP path expect(locator).toBeVisible() failed Locator: locator('[data-status="idip-roster"]') Expected: visible Timeout: 30000ms Error: element(s) not found ` evidence: `/home/swarm/session-runner/idss/test-results/drive-idip/20260919T230228Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 810461e448cb -->
Owner

Claimed by Ben's session (the hand debug IDIP drive is blocked on this). Fixing test-first: Rows initialised empty + a marshalled-JSON assertion, the PendingGroup.Members check, and the consumer guards in MembersScreen.vue / the Overview members column. The orchestrator sweep (item 4) is NOT in this fix.

Claimed by Ben's session (the hand debug IDIP drive is blocked on this). Fixing test-first: `Rows` initialised empty + a marshalled-JSON assertion, the `PendingGroup.Members` check, and the consumer guards in `MembersScreen.vue` / the Overview members column. The orchestrator sweep (item 4) is NOT in this fix.
Owner

Fixed in 2e89fac7: MembersView{Rows: []Row{}} with a red-first seam test on the MARSHALLED bytes, and HttpMembersClient.members() reads rows ?? [] (red-first unit test replaying the live gateway's reply). PendingGroup.Members is always built with at least one row, so it is safe. GOTCHAS #269 carries the recurrence. Not done here: the orchestrator sweep (item 4) — still owed. Seam-proven; the next debug IDIP fire proves it live.

Fixed in `2e89fac7`: `MembersView{Rows: []Row{}}` with a red-first seam test on the MARSHALLED bytes, and `HttpMembersClient.members()` reads `rows ?? []` (red-first unit test replaying the live gateway's reply). `PendingGroup.Members` is always built with at least one row, so it is safe. GOTCHAS #269 carries the recurrence. **Not done here: the orchestrator sweep (item 4)** — still owed. Seam-proven; the next debug IDIP fire proves it live.
ben closed this issue 2026-09-19 23:37:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1641
No description provided.