perf: DB indexes, eliminate double-query delete, strip hot-path debug logging#1
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/Karanpratap7/DevLinkUp/sessions/d771181f-9545-47d8-8a8c-f0895c81784e Co-authored-by: Karanpratap7 <137878890+Karanpratap7@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Karanpratap7/DevLinkUp/sessions/f8bb99cc-7875-4d7b-8a16-b4d507a3c3cc Co-authored-by: Karanpratap7 <137878890+Karanpratap7@users.noreply.github.com>
…ests Agent-Logs-Url: https://github.com/Karanpratap7/DevLinkUp/sessions/54113b85-03ca-4456-9158-b3ae207e3a90 Co-authored-by: Karanpratap7 <137878890+Karanpratap7@users.noreply.github.com>
…inner Agent-Logs-Url: https://github.com/Karanpratap7/DevLinkUp/sessions/54113b85-03ca-4456-9158-b3ae207e3a90 Co-authored-by: Karanpratap7 <137878890+Karanpratap7@users.noreply.github.com>
…ister, AuthContext tests Agent-Logs-Url: https://github.com/Karanpratap7/DevLinkUp/sessions/0a696142-6060-46e0-a141-bc74bd174ffa Co-authored-by: Karanpratap7 <137878890+Karanpratap7@users.noreply.github.com>
… 60/min Agent-Logs-Url: https://github.com/Karanpratap7/DevLinkUp/sessions/0a696142-6060-46e0-a141-bc74bd174ffa Co-authored-by: Karanpratap7 <137878890+Karanpratap7@users.noreply.github.com>
…owner comparison bug Agent-Logs-Url: https://github.com/Karanpratap7/DevLinkUp/sessions/36781746-e387-4359-b941-7fb7a644f608 Co-authored-by: Karanpratap7 <137878890+Karanpratap7@users.noreply.github.com>
…h debug logging Agent-Logs-Url: https://github.com/Karanpratap7/DevLinkUp/sessions/dc173194-4cc5-424f-8c61-aec8a0b36824 Co-authored-by: Karanpratap7 <137878890+Karanpratap7@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Karanpratap7
April 4, 2026 10:08
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Addresses several performance and security gaps across the stack: missing MongoDB indexes on all queried fields, a redundant round-trip on every delete, and an Axios interceptor leaking auth tokens into console logs on every request.
Database indexes
Three indexes added to schema definitions (before
mongoose.model()— after is silently ignored by Mongoose):Eliminate double DB round-trip on delete
deleteProjectwas doingfindById(ownership check) →findByIdAndDelete(delete) — two round-trips for a document already in memory:Strip hot-path debug logging
The Axios request interceptor logged the full config (including
Authorizationheader) on every call; response interceptor logged full payloads. Both removed. 401 redirect logic retained.Dead client API methods removed
userAPI.getProfile— exact duplicate ofuserAPI.getUseruserAPI.updateUser— calledPUT /api/users/:id, a route that has never existedRate limiting on DELETE
/api/projects/:idThe delete route was the only mutation endpoint without rate limiting. Added
mutationLimiter(30 req/min) matching the existing pattern inroutes/users.js.