Bug Description
In saveResume (backend/controllers/resumeController.js), the update branch calls Resume.findOneAndUpdate({ _id: resumeId, user: userId }, { title, latexCode }, { new: true }). If no document matches (wrong ID, deleted resume, or resumeId belonging to another user), this resolves to null, but the handler does not check for that before responding with { success: true, resume: null }.
Steps to Reproduce
- Authenticate as User A and obtain a valid resumeId belonging to User B (or use a resumeId that no longer exists).
- POST to /api/resume/save with { title, latexCode, resumeId } using that resumeId while authenticated as User A.
- Inspect the response.
Expected Behavior
The request should fail with a 404 (or 403) and a clear error message indicating the resume was not found or not owned by the caller — no misleading success response.
Actual Behavior
The endpoint returns HTTP 200 with { success: true, resume: null }. The client displays a save-confirmation even though nothing was persisted or updated, silently discarding the user's edits.
Severity
Medium
Screenshots / Screen Recording
No response
Browser
No response
Operating System
No response
Additional Context
No response
Bug Description
In saveResume (backend/controllers/resumeController.js), the update branch calls
Resume.findOneAndUpdate({ _id: resumeId, user: userId }, { title, latexCode }, { new: true }). If no document matches (wrong ID, deleted resume, or resumeId belonging to another user), this resolves to null, but the handler does not check for that before responding with{ success: true, resume: null }.Steps to Reproduce
Expected Behavior
The request should fail with a 404 (or 403) and a clear error message indicating the resume was not found or not owned by the caller — no misleading success response.
Actual Behavior
The endpoint returns HTTP 200 with { success: true, resume: null }. The client displays a save-confirmation even though nothing was persisted or updated, silently discarding the user's edits.
Severity
Medium
Screenshots / Screen Recording
No response
Browser
No response
Operating System
No response
Additional Context
No response