fix(health): run the context-less health check as the system user #24

Merged
KofTwentyTwo merged 1 commits from feature/health-system-session into develop 2026-10-14 22:36:42 +00:00
KofTwentyTwo commented 2026-10-14 20:14:22 +00:00 (Migrated from github.com)

Problem

When a health request arrives with no QQQ context, BackupsHealthIndicator.check creates a context with a plain new QSession(). Token-based authentication modules (OAuth2, Auth0) reject every tokenless session except QSystemUserSession, so the plan query failed in ActionHelper.validateSession (JWTDecodeException: The token is null).

The same bug in qbit-object-storage left kof22's storage tables empty (QRun-IO/qbit-object-storage#18). kof22 is adopting central health (KofTwentyTwo/Website-Backend#228), so this check would have errored there.

Fix

The context-less path now uses new QSystemUserSession(qInstance). A new test pins the session class.

Tests

./mvnw verify is green locally.

🤖 Generated with Claude Code

## Problem When a health request arrives with no QQQ context, `BackupsHealthIndicator.check` creates a context with a plain `new QSession()`. Token-based authentication modules (OAuth2, Auth0) reject every tokenless session except `QSystemUserSession`, so the plan query failed in `ActionHelper.validateSession` (`JWTDecodeException: The token is null`). The same bug in qbit-object-storage left kof22's storage tables empty (QRun-IO/qbit-object-storage#18). kof22 is adopting central health (KofTwentyTwo/Website-Backend#228), so this check would have errored there. ## Fix The context-less path now uses `new QSystemUserSession(qInstance)`. A new test pins the session class. ## Tests `./mvnw verify` is green locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.