Skip to content

Empty or very short note lists crash with IndexError instead of returning feedback #13

Description

@peterbjohnson

An empty response raises an unhandled IndexError, which reaches the student as a 500 rather than a feedback message.

compare_performance_ED({"notes": []}, reference)
# IndexError: list index out of range

event_alignment_ED indexes response_events[0] to decide whether the input is already grouped into events, before checking that the list is non-empty (evaluation_function/compare_MIDI.py:305).

This is reachable in production: a student submits nothing, or an audio recording transcribes to zero notes (silence, a failed upload, a very quiet recording).

Suggested fix: guard for empty input in compare_performance_ED and return a FeedbackResult with a helpful message ("no notes were detected in your recording"), rather than raising.

Note the container survives the crash: Shimmy returns a 500 and the next request succeeds.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions