Skip to content

fix: preserve existing routine items during updates#717

Open
saurabhhhcodes wants to merge 1 commit into
aryandas2911:mainfrom
saurabhhhcodes:codex/preserve-routine-items-660
Open

fix: preserve existing routine items during updates#717
saurabhhhcodes wants to merge 1 commit into
aryandas2911:mainfrom
saurabhhhcodes:codex/preserve-routine-items-660

Conversation

@saurabhhhcodes
Copy link
Copy Markdown
Contributor

Summary

  • merge incoming routine items with already saved items during routine updates so partial saves do not wipe previous days
  • reuse routine item validation for create/update paths, including empty payloads, minimum duration, and overlap checks
  • validate the merged schedule before persisting to prevent silent data loss

Fixes #660

Testing

  • node --check backend/controllers/routineController.js
  • backend/node_modules/.bin/eslint backend/controllers/routineController.js
  • git diff --check

GSSoC

Please add gssoc:approved, a difficulty label, and relevant type labels if this is accepted for GSSoC scoring.

@saurabhhhcodes
Copy link
Copy Markdown
Contributor Author

Hi maintainers, quick GSSoC follow-up: if this PR is acceptable after review, could you please add gssoc:approved plus the suitable difficulty and type labels? I’m happy to adjust anything before merge if needed.

@saurabhhhcodes saurabhhhcodes force-pushed the codex/preserve-routine-items-660 branch from f53c3ef to dcac466 Compare May 19, 2026 12:36
@saurabhhhcodes
Copy link
Copy Markdown
Contributor Author

Rebased this PR on the latest main so the branch is current again.

Validation after rebase:

  • git diff --check origin/main...HEAD
  • node --check backend/controllers/routineController.js
  • backend/node_modules/.bin/eslint backend/controllers/routineController.js

All passed locally. This should be ready for review/merge whenever you get a chance. If this is eligible for GSSoC scoring, please add gssoc:approved, the appropriate difficulty label, and type:bug since the fix prevents existing routine items from being accidentally dropped during updates.

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: Saving new scheduled tasks overwrites previously saved routine items

1 participant