fix: harden store migrations, auth, and dashboard API calls#28
Open
garywhat wants to merge 1 commit into
Open
Conversation
Several small robustness fixes across the backend: - store: use addColumnIfMissing() for ALTER TABLE migrations instead of bare Exec (avoids errors on re-run, logs skipped duplicates) - store: add error_message index for faster recent-errors queries - auth/jdlogin: handle http.NewRequest errors and add defer resp.Body.Close to prevent connection leaks in QR login flow - auth/middleware: use json.Marshal for error responses instead of string concatenation (prevents JSON injection if msg contains quotes) - dashboard: add 10s timeout to GitHub API client so a slow/unreachable API can't hold handler goroutines indefinitely - dashboard: check json.Encoder return errors instead of ignoring Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Several small robustness fixes across the backend:
addColumnIfMissing()forALTER TABLEmigrations instead of bareExec— avoids errors on re-run and logs skipped duplicateserror_messagefor faster recent-errors querieshttp.NewRequesterrors and adddefer resp.Body.Closeto prevent connection leaks in QR login flowjson.Marshalfor error responses instead of string concatenation (prevents JSON injection ifmsgever contains quotes/backslashes)json.Encoderreturn errors instead of ignoring themTest plan
Generated with Devin