fix: moderators get channel settings that fail with a database error - #256
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 1:55 AM ET / 05:55 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR hides channel settings from moderators, returns clear permission errors from both database stores, and adds regression coverage, documentation, and refreshed embedded web assets. Merge readiness✅ Ready for maintainer review This remains a useful fix absent from current main and v0.5.0. The supplied proof supports the corrected behavior, and no blocking patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherClickClack’s channel settings send updates through its HTTP API to SQLite or PostgreSQL. Server permission checks control whether channel changes and their realtime events are committed. flowchart TD
A[Workspace role] --> B[Channel settings visibility]
B --> C[Channel update request]
C --> D[API identity and scope checks]
D --> E[Database permission check]
E -->|Allowed| F[Save channel and publish event]
E -->|Denied| G[HTTP 403 response]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep channel controls aligned with existing server permissions and reuse the established permission-error response while preserving owner and scoped-bot access. Do we have a high-confidence way to reproduce the issue? Yes: current-main source exposes moderator settings whose permission query rejects their role and whose error becomes HTTP 400. Contributor runtime evidence corroborates this path; this review did not execute it. Is this the best way to solve the issue? Yes: the patch repairs the UI mismatch and reuses an existing permission error without changing the server authorization policy or stored data. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 19e4c4e8631e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Moderators saw channel controls whose updates failed with a raw SQL error. Keep controls consistent with existing owner/scoped-bot authorization and map denied SQLite/PostgreSQL lookups to the established 403 response. Add HTTP, PostgreSQL, role-helper and built-browser regressions, update the workspace documentation, and thank the contributor in the changelog. Co-authored-by: Sergio <cadavidsergio@hotmail.com>
6dfd883 to
c5bed5c
Compare
|
Merged as 1b5d0a7. Thanks @sercada. Verified the root cause on main with the new HTTP regression and a built server: moderator channel updates returned 400 with the raw SQL error. The patched HTTP/PostgreSQL regressions pass, and the two built-server Chromium tests prove moderator rejection plus owner archive/restore. The inspected synthetic before/after pictures are in the PR body. The full local gate completed in stages. Independent review was clean through P2. Exact-head CI was green at c5bed5c: Go, TypeScript, Node 24, full Playwright, Docker and all three desktop platforms. No CI rerun was needed. |
Moderators were offered channel settings even though channel updates have always required an owner or appropriately scoped bot. Saving returned HTTP 400 with
sql: no rows in result set.Align the settings button with the existing authorization rule and translate denied permission lookups to
ErrWorkspaceOwnerRequiredin both SQLite and PostgreSQL. Direct moderator/member updates now return HTTP 403. Owner archive/restore and member moderation remain available. Includes regression coverage, regenerated web assets, documentation, and an Unreleased entry thanking @sercada.Validation:
TestChannelAdministrationIsOwnerOnlyForPeopleand the built server: moderator archive returned 400 with the raw SQL error.Before, moderator sees channel settings:
After, moderator has no channel-settings button:
Owner still opens channel settings and can archive/restore:
The before capture used the connected Chrome profile; after captures are from the repository's Chromium tests after the Chrome extension disconnected. All data shown is synthetic.