Skip to content

bug: Operations feed never shows "your response was not recorded" after a respond race — fetchItems() wipes the copy and the UI only renders it as a refresh-failure detail #2377

Open

Description

@webmixgamer

Summary

On the desktop Operations feed, when POST /api/operator-queue/{id}/respond is refused because the item is no longer pending (409 lost race, #1017; or 400 already terminal), stores/operatorQueue.js::respondToItem sets error to the "your response was not recorded" copy and calls fetchItems() — whose first line sets error = null. The copy is therefore wiped synchronously and is effectively never visible. Even when error does survive, Operations.vue renders it only as the detail line under the "Couldn't refresh the queue — showing the last items that loaded" banner, i.e. under a headline about refreshing, not about an unrecorded answer. The operator's card simply disappears and nothing says their answer was dropped.

Context

Found while pinning the shared respond payload for #2370 (the /m fix). /m routes the same refusal to a persistent page-level notice and scrolls it into view; desktop has no equivalent surface. The copy itself is now the shared, attribution-free QUEUE_RESPONSE_NOT_RECORDED in src/frontend/src/utils/operatorQueue.js; what is missing is a channel that survives the refetch and a headline that names the event. The behavioural store test in src/frontend/tests/unit/operatorQueueResponse.spec.js deliberately does NOT pin the wipe (it asserts only the refetch) so this stays fixable.

Acceptance Criteria

  • After a 409/400 refusal the Operations feed shows a persistent, dismissible notice with the QUEUE_RESPONSE_NOT_RECORDED copy (an InlineError with its own headline — not the detail of the refresh-failed banner), and it survives the immediate refetch and the 10 s poll until dismissed
  • A transient refusal does not masquerade as a refresh failure (the refresh-failed banner appears only when a fetch actually failed)
  • The behavioural store test asserts the notice is observable after respondToItem on a 409 and a 400
  • No change to the respond payload or the agent write-back

Technical Notes

Activity

  1. added
    priority-p3
    type-bug
    theme-ui-ux
    complexity-low
    status-ready
    on Aug 21, 2026
  2. webmixgamer commented on Aug 24, 2026

    @webmixgamer
    ContributorAuthor

    Partially addressed by #2378 (32ded859) — AC3 done, the presentation half remains

    #2378 had to touch this issue's territory: it widened respondRefusedAsNotPending to cover 400 and 404 alongside 409, and those two statuses previously fell through to the generic apiErrorMessage branch and did leave a message. Routing them into the wipe branch without fixing the ordering would have widened this bug to two statuses that used to report — so the wipe is fixed there.

    What is now done

    • The copy survives its own refetch. respondToItem awaits fetchItems() and assigns QUEUE_RESPONSE_NOT_RECORDED after it, instead of assigning first and calling it un-awaited.
    • AC3 — "the behavioural store test asserts the notice is observable after respondToItem on a 409 and a 400" — done, for 404 as well. The spec's old comment that deliberately left the wipe unpinned is gone. Mutation-checked: reverting the fix fails the assertions.

    What remains for this issue

    • AC1 — the notice still has no channel of its own. It rides error, which Operations.vue renders only as the :detail of "Couldn't refresh the queue — showing the last items that loaded."
    • One detail this issue's body doesn't capture, worth knowing before scoping: InlineError puts detail inside a collapsed <details> disclosure labelled "Technical detail". So the operator sees a headline about refreshing and must expand a disclosure to discover their answer was not recorded. The copy reaching the DOM is not the same as the operator reading it.
    • The 15s poll still clears it — fetchItems nulls error on every tick, so the notice is transient even now.
    • AC2 — a refusal still masquerades as a refresh failure.

    The lastRefusal-ref shape suggested in Technical Notes still looks right, and is now the only thing standing between this and done.

    Verified behaviour, for whoever picks this up

    Reproducing the refusal by hand is impossible and it costs time to find that out: POST /respond broadcasts operator_queue_responded, and the other tab's store marks the item responded locally, sub-second, so the card leaves openItems before anyone can click. The way to drive it is to resolve the item directly in the DB — no broadcast, so the open tab still shows it pending — then answer it. Against the running stack, same scenario twice:

    banner message
    before #2378 none at all the card vanishes and the operator is told nothing
    after #2378 renders copy present, one click deep behind "Technical detail"

    🤖 Generated with Claude Code

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

    complexity-lowpriority-p3status-readytheme-ui-uxtype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions