close
Skip to content

fix auth handler race condition#28864

Merged
andig merged 1 commit into
masterfrom
fix/auth_handler
Apr 6, 2026
Merged

fix auth handler race condition#28864
andig merged 1 commit into
masterfrom
fix/auth_handler

Conversation

@naltatis
Copy link
Copy Markdown
Member

@naltatis naltatis commented Apr 6, 2026

fixes #28822

Return 404 if API is called, but requested endpoint is not registered yet.

@naltatis naltatis requested a review from andig April 6, 2026 11:51
@naltatis naltatis added the bug Something isn't working label Apr 6, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider adding a brief comment above the next == nil check explaining under what circumstances next can be nil (e.g., during startup while routes are being registered), so future maintainers understand why this guard exists and don’t inadvertently remove it.
  • If this Not Found response is user-facing, you may want to reuse a shared/not-found handler or at least match any existing 404 response format (e.g., empty body or JSON) to keep error responses consistent across the API.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a brief comment above the `next == nil` check explaining under what circumstances `next` can be nil (e.g., during startup while routes are being registered), so future maintainers understand why this guard exists and don’t inadvertently remove it.
- If this `Not Found` response is user-facing, you may want to reuse a shared/not-found handler or at least match any existing 404 response format (e.g., empty body or JSON) to keep error responses consistent across the API.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@andig andig merged commit 3967594 into master Apr 6, 2026
19 checks passed
@andig andig deleted the fix/auth_handler branch April 6, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error report during start of evcc server

2 participants