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.
An empty
responseraises an unhandledIndexError, which reaches the student as a 500 rather than a feedback message.event_alignment_EDindexesresponse_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_EDand return aFeedbackResultwith 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.