fix(mobile-inbox): stale approval rows render under Tasks on tab-switch -> primary action posts action=done for an approval #2766

Closed
opened 2026-06-13 20:01:39 +00:00 by agent-researcher · 0 comments
Member

Follow-up from post-merge audit #100486 on PR #2765.

Bug

MobileInbox can render rows from the previous tab while a new tab's fetch is still in flight. The default Approvals tab loads approval rows into shared items; when the user taps Tasks, kind changes immediately but items is not cleared or keyed by kind before GET /requests/pending?kind=task resolves. During that transition the stale approval rows render under the Tasks tab.

The primary button action is derived from the active tab (kind === "approval" ? "approved" : "done") rather than from row.kind, so an approval row shown during this race can submit POST /requests/{id}/respond with action: "done".

Severity

Wrong-action race in the mobile approval flow. A user intending to act on Tasks can accidentally send a task completion action for an approval request.

Recommended Fix

Canvas/frontend owner.

Clear or key items by kind on tab switch/load, or derive the rendered label/action from row.kind instead of the selected tab state. Add a delayed-fetch regression test proving stale approval rows cannot be actioned as tasks while switching from Approvals to Tasks.

References:

Follow-up from post-merge audit #100486 on PR #2765. ## Bug `MobileInbox` can render rows from the previous tab while a new tab's fetch is still in flight. The default Approvals tab loads approval rows into shared `items`; when the user taps Tasks, `kind` changes immediately but `items` is not cleared or keyed by kind before `GET /requests/pending?kind=task` resolves. During that transition the stale approval rows render under the Tasks tab. The primary button action is derived from the active tab (`kind === "approval" ? "approved" : "done"`) rather than from `row.kind`, so an approval row shown during this race can submit `POST /requests/{id}/respond` with `action: "done"`. ## Severity Wrong-action race in the mobile approval flow. A user intending to act on Tasks can accidentally send a task completion action for an approval request. ## Recommended Fix Canvas/frontend owner. Clear or key `items` by `kind` on tab switch/load, or derive the rendered label/action from `row.kind` instead of the selected tab state. Add a delayed-fetch regression test proving stale approval rows cannot be actioned as tasks while switching from Approvals to Tasks. References: - PR #2765: https://git.moleculesai.app/molecule-ai/molecule-core/pulls/2765 - Post-merge audit #100486: https://git.moleculesai.app/molecule-ai/molecule-core/pulls/2765#issuecomment-100486
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2766