Repository navigation
fix(admin): keep privilege edits per database, and admit unknown user status - #524
Merged
Merged
Conversation
… status Two ways the admin panel quietly told the user something untrue. The privileges editor held one pair of sets — current and edited — for whichever database was selected. Switching database reloaded into those same sets, so edits made on the first one were gone, with no warning and no way back. Privileges are now keyed by database, so switching away and back returns to the pending edit rather than to the server's state, Apply emits statements for every database with changes rather than only the visible one, and Reset clears them all rather than leaving edits behind on databases that are off screen. Databases with unapplied changes are marked in the dropdown and named above it, because Apply sending changes the user cannot currently see is only reasonable if the UI says so. (#441) The user list falls back to a narrower query when the full one fails, which happens on MariaDB and under a restricted grant. The fallback cannot read account_locked or password_expired, so it filled them with null — and null rendered as no badge, which is exactly how a healthy account renders. A locked account appeared unremarkable. The fallback is now recorded and those accounts show an explicit "unknown" marker explaining that the server did not expose the columns. The first error is logged rather than discarded. (#440) The issue for the second described the empty catch as swallowing failures. It does not quite — a real failure still surfaces from the second query's catch. The defect is narrower and worse: the two queries disagreeing produces a confident wrong answer rather than an error. That is recorded on the issue. The persistence tests were checked against the unfixed code and fail there, and they scope their queries to the database section — the global privilege checkboxes come first in the DOM, so an unscoped selector would have toggled a global privilege and passed no matter what. Refs #440, #441
This was referenced Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #440, #441. Two ways the admin panel quietly told the user something untrue.
Privilege edits vanished on a database switch (#441)
The editor held one pair of sets —
currentandedited— for whichever database was selected. Switching database reloaded into those same sets, so edits on the first one were gone: no warning, no way back, and the checkboxes simply looked like the user had never touched them.Privileges are now keyed by database:
A locked account looked like a healthy one (#440)
The user list falls back to a narrower query when the full one fails — MariaDB lacks some columns, and so does a restricted grant. The fallback can't read
account_lockedorpassword_expired, so it filled them withnull, andnullrendered as no badge: exactly how a healthy account renders.Those accounts now show an explicit
unknownmarker with a tooltip explaining the server didn't expose the columns, and the first error is logged rather than discarded.Note on the issue's framing: #440 describes the empty catch as swallowing failures. It doesn't quite — a genuine failure still surfaces from the second query's catch. The defect is narrower and worse than "an error goes missing": the two queries disagreeing produces a confident wrong answer. I've recorded that on the issue.
On the tests
Two things worth flagging, because both would have produced tests that passed while proving nothing:
getAllByRole("checkbox")[0]is a global toggle — which persists across a database switch regardless, and would have passed no matter what. That's why there's adata-testidon the database grid.1650 frontend tests, 66 integration tests against MySQL 8 + MariaDB 11, clippy/tsc/dprint clean.
🤖 Generated with Claude Code