Conversation
… connections and refactoring API routes This commit addresses the reported `read ECONNRESET` and heartbeat errors by: 1. Adding pool-level error handling to the MySQL database controller. 2. Adding error and shardError listeners to the Discord client. 3. Refactoring all major API routes to use async/await with Promises for database queries, ensuring proper response flow control and preventing 'Reply already sent' errors. 4. Cleaning up redundant imports in app.js. 5. Updating common API helpers to return status and be used more robustly in routes. 6. Using parameterized SQL queries in several locations to improve security. Co-authored-by: benrobson <15405528+benrobson@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The application was suffering from instability manifested as
read ECONNRESETerrors and Discord heartbeat failures. Investigation revealed that the API routes (which the website calls recursively viafetch) were using a buggy callback pattern that often led to multiple response attempts or hanging requests, overwhelming the server and the MySQL connection pool.This PR fixes these issues by:
app.jsthat could cause multiple module initializations.PR created automatically by Jules for task 17554862004116618049 started by @benrobson