Create client ids without crypto.randomUUID #9

Closed
Grovy311 wants to merge 0 commits from fix/client-id-insecure-context into main
Collaborator

Fehler: Über http im LAN (kein HTTPS, kein localhost) scheitert im Stromkreis-Editor jedes Anlegen mit „crypto.randomUUID is not a function“. Betroffen sind Stromkreise, Gerätezeilen, Gruppen, Verteilergeräte und auch das Tippen in der „-frei-“-Zeile.

Fix: createClientId() (src/frontend/utils/client-id.ts) nutzt crypto.randomUUID() und fällt sonst auf eine RFC-4122-v4-UUID aus crypto.getRandomValues() zurück. Die Regel steht in AGENTS.md, dazu 3 Tests.

Keine Abhängigkeiten.

Geprüft auf dem Branch allein: alle drei tsc-Konfigurationen, npm test 418/418, Produktions-Build (build:api + build:web). Zusammen mit allen anderen Branches: 509/509 Tests, konfliktfrei in jeder Merge-Reihenfolge.

Merge-Reihenfolge aller Branches:

  1. fix/client-id-insecure-context (#9)
  2. feature/editor-ui (#10)
  3. feature/cable-sizing (#11)
  4. feature/overview-filters (#12)
  5. feature/circuit-list-usability (#13)
  6. feature/card-look (#14)
  7. feature/print-view (#15)
  8. feature/building-structure (#16)
  9. feature/estimate-balance (#17)

🤖 Generated with Claude Code

**Fehler:** Über http im LAN (kein HTTPS, kein localhost) scheitert im Stromkreis-Editor jedes Anlegen mit „crypto.randomUUID is not a function“. Betroffen sind Stromkreise, Gerätezeilen, Gruppen, Verteilergeräte und auch das Tippen in der „-frei-“-Zeile. **Fix:** `createClientId()` (`src/frontend/utils/client-id.ts`) nutzt `crypto.randomUUID()` und fällt sonst auf eine RFC-4122-v4-UUID aus `crypto.getRandomValues()` zurück. Die Regel steht in AGENTS.md, dazu 3 Tests. Keine Abhängigkeiten. Geprüft auf dem Branch allein: alle drei `tsc`-Konfigurationen, `npm test` 418/418, Produktions-Build (`build:api` + `build:web`). Zusammen mit allen anderen Branches: 509/509 Tests, konfliktfrei in jeder Merge-Reihenfolge. Merge-Reihenfolge aller Branches: 1. `fix/client-id-insecure-context` (#9) 2. `feature/editor-ui` (#10) 3. `feature/cable-sizing` (#11) 4. `feature/overview-filters` (#12) 5. `feature/circuit-list-usability` (#13) 6. `feature/card-look` (#14) 7. `feature/print-view` (#15) 8. `feature/building-structure` (#16) 9. `feature/estimate-balance` (#17) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Grovy311 added 1 commit 2026-09-26 20:14:41 +02:00
crypto.randomUUID() is only defined in secure contexts (HTTPS or
localhost). Opened over plain HTTP from another machine in the LAN, the
circuit list editor failed with "crypto.randomUUID is not a function"
whenever it created a circuit, device row, circuit group or distribution
board component, including typing into the -frei- row.

createClientId() uses crypto.randomUUID() where available and otherwise
builds an RFC 4122 version 4 UUID from crypto.getRandomValues(), which
works in every context. AGENTS.md notes the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner

Integriert in main per Fast-Forward, unverändert übernommen.

Commit: 79fcb75ffb

Anpassungen: keine.

Integriert in `main` per Fast-Forward, unverändert übernommen. Commit: 79fcb75ffbde6298922e87810987db540a0b1acd Anpassungen: keine.
jappel closed this pull request 2026-09-26 21:42:22 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Dependencies

No dependencies set.

Reference: jappel/leistungsbilanz-ts#9
No description provided.