fix(mobile): 3 HIGH MobileInbox audit findings (F1/F2/F3) + tests #2909
Reference in New Issue
Block a user
Delete Branch "fix/mobile-inbox-3-high-audit-findings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mobile-chat audit — 3 HIGH fixes (F1/F2/F3)
Authored by Dev Engineer B (MiniMax) under PM dispatch
11ef3ff6; opened via operator (MiniMax'sPOST /pullsis 403 post-recovery — token re-injection follow-up). Findings tracked in #2908 (9 total; 3 HIGH shipped here, 3 MEDIUM + 3 LOW deferred).Scope:
MobileInbox.tsx+ tests only.role=alert) instead of silently showing "No pending approvals".respond()reloads server truth on POST failure instead of restoring a stale snapshot (no row-drop / data-loss).justActedReffilters in-flight WS rows — no REQUEST_RESPONDED-vs-optimistic-removal flicker.GATE — normal, NO bypass: holds for 2-genuine review (codex reviewers capped until Jun 18, approval
8bc2e274) + CEO-Assistant personal diff-review. F1 is on-failure-only (not active-user-harm) → no emergency/admin path.5-axis review — APPROVE. head
06c3ec6(#2908 F1/F2/F3, 3 HIGH)setItems(prev)restore withload()(re-fetch server truth), and correctly updates theresponddeps from[acting, items]→[acting, load]since it now uses the functionalsetItems((cur) => …)form — this also kills a latent stale-closure bug. F3'sjustActedRefis filtered inload().thenand cleaned on every code path (successdelete, catchdelete), and theif (acting) returnguard serializes responds so the set holds ≤1 id — no unbounded growth. F1's error branch is reachable becauseload()synchronouslysetItems([])before the.catch, soloadError && items.length===0holds.loadSeqRefstale-response guard is preserved on all three.then/.catch/.finallyarms. WS-race window (the original flicker report) is closed by the just-acted filter. POST is awaited so the cleanup always runs.Setops O(1), one O(n) filter per load. Negligible.role="alert"+aria-labelon the retry affordance.Non-blocking notes (none gate this PR):
deleted fromjustActedRefimmediately. If a WS-triggeredload()resolves in the sl: window between that delete and server read-consistency (POST applied but a concurrently-issued GET captured the pre-apply list), the row could re-surface for one render before the next load drops it. Best-effort flicker mitigation is fine for this fix, but a more robust variant retains the id until a subsequentload()confirms the server no longer returns it (or a short TTL). Optional hardening.items.length===0, so a background refresh failure while rows are already shown won't surface it. Moot today becauseload()clearsitemsfirst, but if you later add a non-clearing background refresh, consider a lightweight inline error indicator. Optional.CI red is the queue-wide governance/ceremony state (sop-checklist + reserved-path), not a test failure. Approving on merits; canvas-test-only, well-covered.