Skip to content

project note handlers return 500 instead of 404 for a nonexistent project #592

Description

@ericfitz

Same class as #579, found while fixing it but out of scope there.

api/project_note_handlers.go has six sites (roughly lines 24-29, 93-98, 167-172, 212-217, 301-306, 375-380) where a NON-admin caller requesting a nonexistent project gets IsProjectTeamMemberOrAdmin returning gorm.ErrRecordNotFound, which is mapped to 500 "Failed to check authorization" instead of 404.

CATS never hit this because the fuzzing identity is an admin, and the admin fast path skips the project lookup entirely.

404 is already documented for all note operations, so this is a handler-only fix following the same pattern as the #579 change. Violates the zero-500 policy.

team_note_handlers.go is NOT affected — IsTeamMemberOrAdmin uses a Count query that cannot return ErrRecordNotFound, so a nonexistent team yields 403.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions