You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #27 added protections around admin account management, including preventing unsafe self-actions, protecting the last active admin, and revoking sessions when an account is blocked.
This issue tracks that follow-up separately from the concurrency/TOCTOU work in #28.
What should be covered
Add focused repository-level tests for the behavior introduced in #27, particularly:
An admin cannot perform a prohibited block/demotion action against their own account.
The last active admin cannot be blocked or demoted when doing so would leave no active administrator.
The operation is allowed when another eligible active admin remains.
Blocking or deactivating a user revokes their existing sessions.
A rejected operation does not leave partial account or session changes behind.
The tests should exercise the repository behavior directly rather than relying only on higher-level route or integration coverage.
Why this matters
These checks protect administrative access and session state. Having direct tests makes the intended behavior explicit and helps prevent a future repository refactor from weakening one of these protections while the broader test suite continues to pass.
Context
PR #27 added protections around admin account management, including preventing unsafe self-actions, protecting the last active admin, and revoking sessions when an account is blocked.
This issue tracks that follow-up separately from the concurrency/TOCTOU work in #28.
What should be covered
Add focused repository-level tests for the behavior introduced in #27, particularly:
The tests should exercise the repository behavior directly rather than relying only on higher-level route or integration coverage.
Why this matters
These checks protect administrative access and session state. Having direct tests makes the intended behavior explicit and helps prevent a future repository refactor from weakening one of these protections while the broader test suite continues to pass.
Acceptance criteria
Related: #27
Separate concurrency follow-up: #28