Skip to content

fix: validate daily focus input#3213

Merged
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
saurabhhhcodes:fix/daily-focus-validation-3164
Jul 19, 2026
Merged

fix: validate daily focus input#3213
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
saurabhhhcodes:fix/daily-focus-validation-3164

Conversation

@saurabhhhcodes

Copy link
Copy Markdown
Contributor

Summary

  • sanitize and cap daily focus goal text before persistence
  • validate requested dates across POST, GET, and DELETE
  • add focused route tests for invalid input and sanitized saves

Closes #3164

Validation

  • npx vitest run test/daily-focus-validation.test.ts --environment node
  • npm run type-check
  • npx eslint src/app/api/daily-focus/route.ts test/daily-focus-validation.test.ts
  • git diff --check

Note: the default jsdom Vitest harness is incompatible with the repository's installed undici/jsdom combination under Node 26; the server-route suite passes in the Node environment.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:testing GSSoC type bonus: tests (+10 pts) labels Jul 17, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@github-actions github-actions Bot added type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) labels Jul 17, 2026
@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level2 GSSoC Level 2 - Medium complexity (25 points) quality:clean GSSoC: Clean quality multiplier (×1.2) labels Jul 19, 2026
@Priyanshu-byte-coder
Priyanshu-byte-coder merged commit 3851c13 into Priyanshu-byte-coder:main Jul 19, 2026
18 of 19 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Merged! Thanks for contributing to DevTrack.

If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers.

Keep an eye on open issues for your next contribution!

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

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level2 GSSoC Level 2 - Medium complexity (25 points) quality:clean GSSoC: Clean quality multiplier (×1.2) type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Data-integrity] /api/daily-focus POST does not validate goal_text length or date format

2 participants