Skip to content

Type Coercion Error in Routine endTime Calculation Bypasses Overlap Validation #1652

Description

@Abhishek2005-ard

Description

There is a logic bug in backend/controllers/routineController.js inside both the createRoutine and updateRoutine functions caused by unsafe type coercion.

When the server calculates the endTime of a routine task to check for scheduling overlaps, it relies on the + operator:

const endTime = item.startTime + item.duration;

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendIssues related to server-side, database logic or APIsbugSomething isn't workingfrontendIssues related to UI/UX

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions