Skip to content

01a03930 - Send clerkUserDataId instead of clerk name - #1427

Open
joshuakrueger-dfx wants to merge 5 commits into
DFXswiss:developfrom
joshuakrueger-dfx:feat/support-clerk-userdata
Open

01a03930 - Send clerkUserDataId instead of clerk name#1427
joshuakrueger-dfx wants to merge 5 commits into
DFXswiss:developfrom
joshuakrueger-dfx:feat/support-clerk-userdata

Conversation

@joshuakrueger-dfx

@joshuakrueger-dfx joshuakrueger-dfx commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

EN:
The support dashboard assigns tickets by staff userData id instead of a clerk name string. PUT sends clerkUserDataId; GET /clerks is { userDataId, name }[]; display still uses the name. Pair with the backend PR that rejects leftover clerk names.

DE:
Das Support-Dashboard weist Tickets per Staff-userData-Id zu, nicht per Namens-String. PUT sendet clerkUserDataId; GET /clerks ist { userDataId, name }[]; die Anzeige bleibt der Name. Gehört zum Backend-PR, der den alten clerk-Namen ablehnt.

Details

Not symptom-driven: sending a clerk name would keep splitting history (Josh / JOSHUA BEN KRUEGER) and 400 once the backend rejects leftover clerk.

Scale: the same clerk-list and assign form is used on every support ticket; RealUnit has the twin path.

Scale (90e0dc5): 14 files, +475/−76, 5 commits

Smaller fix considered: keep sending the name and let the backend resolve it — insufficient because the client would still own the identity key.

Skipped check (K1.6a): services skips Build and test on draft PRs until the ci label or ready_for_review; this marker lets the first ready kick start CI.
Skipped check (K1.13): same draft skip on pr.yml, codeql.yml and pr-review-bot.yml; those jobs start after ready or a ci label.

Round check (90e0dc5):
Twins: RealUnit issue screen uses the same clerkAssignmentPayload leftover/allowlist path as DFX.
New surface: leftover-name unassign sends null; mine matches JWT account id, leftover name only when the id is missing.
Previous findings: empty select left leftover names assigned; mine filtered only by verifiedName; getClerks failed silently. Closed on this SHA.

What changed

  • GET /support/issue/clerks (and RealUnit) is consumed as { userDataId, name }[].
  • GET /clerk returns { clerkUserDataId, clerk }.
  • Issue update sends clerkUserDataId (omit when unchanged, null to unassign). A leftover name stays selected until the clerk field is cleared.
  • Assignment ids not on the clerks list are dropped; a failed clerks fetch surfaces as an error.
  • Overview "My tickets" matches clerkUserDataId to the JWT account; leftover clerk names only when the id is still missing.
  • Limit-request PDF clerk stays a JWT-stamped name at generation time; stored identity is the backend FK.
  • DFX issue detail has a Playwright baseline (support-dashboard-02-issue.png).

Deploy

Backend first (column + reject leftover clerk), then this PR. Until this lands, support-issue PUT from the current dashboard returns 400.

Tests

Node 20: 2 suites / 29 tests (realunit-dashboard.hook.test, support-dashboard.hook.test) including leftover unassign, allowlist and isAssignedToMe. Mutation: inverting the account-id comparison fails 2 of 3 isAssignedToMe tests. Playwright: 1/1 passed (e2e/support-dashboard-issue.spec.ts) with committed darwin baseline on the previous head; not re-run after the leftover/mine commit.

Final pass (90e0dc5):
Coherent: dashboard assign/unassign uses clerkUserDataId; clerks list is objects; mine uses the account id.
Nothing extra: no live-API e2e; issue screenshot uses a synthetic JWT; no alias matching on leftover names in the overview.
Sources closed: PUT omit/null, leftover unassign, object clerks, RealUnit twin, mine-by-account, handbook issue screen; companion backend#5184.

Assign support tickets by staff userData id so a renamed clerk no longer splits history.
@joshuakrueger-dfx

Copy link
Copy Markdown
Contributor Author

EN:
Closed: the identity fix lives in one backend PR that keeps the existing clerk-name contract, so this services change is not needed.

DE:
Geschlossen: der Identitätsfix liegt in einem Backend-PR, der den bestehenden Clerk-Namen-Vertrag hält, dieser Services-Change entfällt.

The issue screen reads userDataId/name from GET /clerks. The Playwright fixture still sent string names, so the clerk select had no labels.
@joshuakrueger-dfx
joshuakrueger-dfx marked this pull request as ready for review August 25, 2026 19:35
@joshuakrueger-dfx
joshuakrueger-dfx marked this pull request as draft August 25, 2026 20:07
Empty select with a leftover name sends null. Mine uses the JWT account id,
and leftover names only when the id is still missing. Assignment ids not on
the clerks list are dropped; a failed clerks fetch surfaces as an error.
An empty select with a leftover name meant unassign. Combined state updates
used that empty init and would have cleared leftover assignment.
@joshuakrueger-dfx
joshuakrueger-dfx marked this pull request as ready for review August 26, 2026 11:05
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