Skip to content

Commit e20a24b

Browse files
fix(submitter): submit_batch/2 crashed on every call (MatchError) (#48)
## Bug `FeedbackATron.Submitter.submit_batch/2` — a public API — raised `MatchError` on **every** call with a non-empty issue list, crashing the `Submitter` GenServer. `handle_call({:submit_batch, ...})` maps over issues and matches the inner `handle_call({:submit, ...})` against a bare `{:ok, id, result}`. But `handle_call` returns a GenServer **`{:reply, {:ok, id, result}, state}` 3-tuple** — so the match always failed. Found while running the suite during pipeline work (the existing test `submitter_test.exs` `submit_batch/2 batch submission processes multiple issues` was red). ## Fix Destructure the reply payload: `{:reply, {:ok, id, result}, _new_state} = handle_call(...)`. ## Verification Previously-failing test now passes; **full suite green (139 tests, 0 failures)**. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 05d2d3b commit e20a24b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

elixir-mcp/lib/feedback_a_tron/submitter.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ defmodule FeedbackATron.Submitter do
119119
@impl true
120120
def handle_call({:submit_batch, issues, opts}, _from, state) do
121121
results = Enum.map(issues, fn issue ->
122-
{:ok, id, result} = handle_call({:submit, issue, opts}, nil, state)
122+
# handle_call({:submit, ...}) returns a GenServer {:reply, payload, state}
123+
# 3-tuple; destructure the reply payload, not a bare {:ok, id, result}.
124+
{:reply, {:ok, id, result}, _new_state} = handle_call({:submit, issue, opts}, nil, state)
123125
{id, result}
124126
end)
125127
{:reply, {:ok, results}, state}

0 commit comments

Comments
 (0)