166-19-11-7-5-1-aditi-mishra - #326
Open
Adi-1805 wants to merge 1 commit into
Open
Conversation
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.
Resolves all 6 assigned qualification issues across Bug, Security, Feature, UI, and UX categories. Fixes cascade task deletion leaving orphaned submission records (#5), successive submissions returning stale data (#1), an IDOR vulnerability with missing ObjectId validation and broken authorization checks (#7), adds server-side search and status filtering to the Admin task list (#11), separates Available Tasks discovery and My Tasks into distinct routes with search/sort controls (#166), and replaces the bare logout icon with a clearly labelled "Sign Out" button (#19).
Checklist
cd client && npm run lint && npm run buildandcd server && npm run lint && npm run buildlocallyShort Demo Video (required)
🎥 Demo Video: https://youtu.be/wkybU7GFj_U
Required Checklist
Task & Workflow
166-19-11-7-5-1-aditi-mishra)master) was pulled immediately before opening this PRQuality & Safety
Checklist Completion Rule
The checklist must be completed after the Pull Request is opened.
Process:
Incomplete or incorrect checklists will result in the PR being closed.
What Was Done
🐛 Closes #5 — Task Deletion Leaves Orphaned Records
server/controllers/taskController.jsdeleteTaskonly removed the Task document, leaving Submission records behind as orphaned data.Fix:
Promise.allnow atomically deletes the Task and all associated Submission documents in one operation.🐛 Closes #1 — Successive Task Submissions Overwrite Previous Data
server/controllers/submissionController.js,server/models/Submission.jsgetSubmissionfetched without sorting so stale records could be returned.reviewStatushad no schema-level enum constraint allowing arbitrary string values.Fix:
getSubmissionnow uses.sort({ createdAt: -1 }).Submission.jsenforcesenum: ['Pending', 'Approved', 'Rejected'].reviewSubmissionvalidates the incoming status before persisting.🔐 Closes #7 — IDOR Vulnerability in Task Details API
taskController.js,submissionController.js,talentController.jsMalformed IDs passed directly to Mongoose caused unhandled
CastError(500). Talent users could access any task by ID. The IDOR check ingetSubmissionincorrectly compared a populated Mongoose object using.toString().Fix:
mongoose.Types.ObjectId.isValid()guards on all ID params return a clean400. Talent IDOR check ingetTaskByIdrestricts access to Open or self-assigned tasks.getSubmissioncorrected to use.talentId._id.toString().reviewSubmissionnow syncs the parent Task status toApprovedorRejected.✨ Closes #11 — Add Search and Status Filtering to Admin Task List
taskController.js,client/src/api/tasks.js,AdminDashboard.jsxgetAllTasksalways returned every task with no filtering support.Fix: Accepts
search(MongoDB$regex, case-insensitive on title and description) andstatus(exact match) query params. The client passes these on every keystroke, debounced at 300ms.🎨 Closes #166 — Available Tasks Discovery Redesign
App.jsx,TalentDashboard.jsx,AvailableTasksList.jsxAvailable Tasks and My Tasks were rendered together on one page. Clicking "My Tasks" in the sidebar caused a 404.
Fix: Added
/talent/tasksroute inApp.jsx.TalentDashboardusesuseLocationto conditionally render the discovery board at/talent/dashboardor the assigned tasks list at/talent/tasks.AvailableTasksListgains a local search bar and sort dropdown (Newest / Due Date / A–Z).🖱️ Closes #19 — Logout Button Lacks Clear Affordance
admin/Sidebar.jsx,talent/TalentSidebar.jsxThe logout was a bare icon with no visible label or interactive affordance.
Fix: Replaced with a full-width "Sign Out" button with a red-tinted background, visible border, and hover deepening effect in both Admin and Talent sidebars.