Return fallback context for incomplete Gitea current-user payload #91

Closed
opened 2026-08-06 09:16:23 +00:00 by rockachopa · 0 comments
Member

Evidence

src/main.py only validates that the current-user payload is an object before leaving the guarded block, then indexes id and login. A valid JSON object missing either required field raises KeyError outside fallback handling and turns /api/v1/context into a 500 instead of its documented fallback response.

Acceptance criteria

  • Incomplete current-user objects return the normal context fallback with a useful error.
  • Existing valid context behavior remains unchanged.
  • Add a behavioral regression test using strict TDD.
## Evidence `src/main.py` only validates that the current-user payload is an object before leaving the guarded block, then indexes `id` and `login`. A valid JSON object missing either required field raises `KeyError` outside fallback handling and turns `/api/v1/context` into a 500 instead of its documented fallback response. ## Acceptance criteria - Incomplete current-user objects return the normal context fallback with a useful error. - Existing valid context behavior remains unchanged. - Add a behavioral regression test using strict TDD.
timmy was assigned by rockachopa 2026-08-06 09:16:23 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#91
No description provided.