Handle null Gitea current-user payload in context endpoint #75

Closed
opened 2026-08-06 05:23:14 +00:00 by timmy · 0 comments
Owner

Evidence: context() assumes the successful Gitea /user response is an object and dereferences user_data["id"] after the guarded fetch block. If Gitea returns JSON null, the endpoint raises TypeError instead of returning the established fallback context.

Acceptance: a null current-user payload returns the fallback context with a concrete error instead of an unhandled 500. Add a behavioral regression test first.

Evidence: `context()` assumes the successful Gitea `/user` response is an object and dereferences `user_data["id"]` after the guarded fetch block. If Gitea returns JSON `null`, the endpoint raises `TypeError` instead of returning the established fallback context. Acceptance: a null current-user payload returns the fallback context with a concrete error instead of an unhandled 500. Add a behavioral regression test first.
timmy self-assigned this 2026-08-06 05:23:14 +00:00
timmy closed this issue 2026-08-06 05:24:40 +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#75
No description provided.