Skip to content

bug: /api/tasks may not finalize prepared statement on validation errors #727

@gowthamrdyy

Description

@gowthamrdyy

Problem\nPOST /api/tasks prepares an SQLite statement, but in some validation-error paths it returns a response without finalizing the prepared statement. This can leak resources and may lead to "database is locked" issues under load or repeated requests.\n\n# Current Behavior\nWhen all provided tasks are invalid and inserted = 0, the handler can respond before stmt.finalize() is called.\n\n# Expected Behavior\nAlways call stmt.finalize() before responding (success or error), regardless of which path is taken.\n\n# Steps to Reproduce\n1. Start the server\n2. POST to /api/tasks with an invalid payload (missing title/subject/due_at)\n3. Repeat a few times; prepared statements should not accumulate

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions