fix(workspaces): keep a workspace with a reserved slug editable - #179
fix(workspaces): keep a workspace with a reserved slug editable#179sercada wants to merge 1 commit into
Conversation
The Access-provisioned default workspace owns the reserved slug
"clickclack". Its settings form submits the current slug together with the
name, and normalizeWorkspaceSettings rejected any reserved slug regardless
of whether it changed, so the workspace could never be renamed or given an
icon ("workspace slug is reserved"). Reject a reserved slug only when it
differs from the workspace's current slug; moving to a reserved slug, or
taking one from a regular workspace, stays rejected.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Evidence note: |
|
Codex review: needs real behavior proof before merge. Reviewed August 29, 2026, 2:05 AM ET / 06:05 UTC. ClawSweeper reviewWhat this changesThe PR permits an Access-provisioned workspace to retain its existing reserved slug during a profile update and adds SQLite regression coverage. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readiness⛔ Blocked until real behavior proof is added - 4 items remain The patch correctly fixes the current default-branch validation failure in both stores, but it still needs inspectable after-fix behavior proof before merge; one copied code comment also overstates the affected icon-upload path. Priority: P2 Review scores
Verification
How this fits togetherWorkspace profile updates flow from the settings page through the workspace API into SQLite or PostgreSQL validation before storage. The supplied slug controls whether the metadata update proceeds or returns a validation error. flowchart LR
A[Workspace settings page] --> B[Workspace update API]
B --> C[SQLite or PostgreSQL store]
C --> D[Normalize supplied slug]
D --> E{Does slug change?}
E -->|No| F[Keep existing reserved slug]
E -->|Yes, reserved| G[Return validation error]
F --> H[Persist workspace metadata]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the mirrored validation change after a redacted real workspace-profile update demonstrates that retaining clickclack succeeds while reserved destination changes remain rejected. Do we have a high-confidence way to reproduce the issue? Yes, from source: the current settings page submits the unchanged slug during a profile save and current main rejects it in both stores; the default provisioner creates the clickclack workspace. Is this the best way to solve the issue? Yes, the normalized-slug equality check is the narrowest repair: it preserves rejection of attempts to move into a reserved slug while restoring updates for the workspace that already owns one. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 486fd23545af. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
What Problem This Solves
The workspace that Cloudflare Access provisioning creates owns the reserved slug
clickclack. Its Overview settings form submits the current slug together with the name, andnormalizeWorkspaceSettings(sqlite and postgres stores) rejected any reserved slug regardless of whether it changed. Result: that workspace can never be renamed or given an icon from the UI — every save fails withworkspace slug is reserved, even when only the name changed.Why This Change Was Made
Reject a reserved slug only when it differs from the workspace's current slug. Moving a workspace to a reserved slug, or a regular workspace trying to take one, stays rejected exactly as before. Same change in both store implementations.
User Impact
Owners of the Access-provisioned default workspace can rename it and set its icon. No other behaviour changes.
Evidence
TestUpdateWorkspaceKeepsReservedSlugEditable(sqlite): rename with the unchanged reserved slug succeeds; moving toguestsis rejected; a regular workspace cannot takeclickclack.go test ./apps/api/internal/store/sqlite/ ./apps/api/internal/httpapi/: ok.go build ./...,go vet,gofmt -lclean.workspace slug is reserved).