Skip to content

fix(tasks): add length validation to updateTask to match createTask limits [NSoC'26]#166

Open
anshul23102 wants to merge 1 commit into
Shriii19:masterfrom
anshul23102:fix/162-updatetask-length-validation
Open

fix(tasks): add length validation to updateTask to match createTask limits [NSoC'26]#166
anshul23102 wants to merge 1 commit into
Shriii19:masterfrom
anshul23102:fix/162-updatetask-length-validation

Conversation

@anshul23102
Copy link
Copy Markdown

Description

createTask validated that title does not exceed 200 characters and description does not exceed 5000 characters. updateTask had no corresponding validation, allowing an authenticated user to bypass creation-time limits by sending an oversized payload to PATCH /tasks/:id/edit.

Changes Made

File Change
backend/controllers/tasks.controller.js Added title non-empty check, 200-character title limit, and 5000-character description limit to updateTask

Testing Done

  • PATCH /tasks/:id/edit with title: "A".repeat(201) returns 400.
  • PATCH /tasks/:id/edit with description: "A".repeat(5001) returns 400.
  • Valid updates proceed normally.

Checklist

  • No merge conflicts with master
  • No em dashes or double hyphens in comments
  • Changes focused on the reported surface

Closes #162

…imits [NSoC'26]

createTask validated that title does not exceed 200 characters and description
does not exceed 5000 characters. updateTask had no length validation, so an
authenticated user could bypass creation-time limits by sending an oversized
payload to PATCH /tasks/:id/edit.

Added the same validation guards to updateTask so both creation and update
paths enforce consistent input limits before writing to Supabase.

Closes Shriii19#162
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@anshul23102 is attempting to deploy a commit to the shreemp194-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

👋 Thank you for opening this pull request! I will review your changes and assist you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: updateTask does not validate title and description length, allowing oversized strings to bypass server-side limits

1 participant