[WOOMOB-3751] Recover from deterministic refund rejections instead of retrying - #16440
[WOOMOB-3751] Recover from deterministic refund rejections instead of retrying#16440samiuelson wants to merge 8 commits into
Conversation
Generated by 🚫 Danger |
|
|
This reverts commit 6e0df54.
…rministic-refund
There was a problem hiding this comment.
AI Code Review - No issues found. The changes look good.
Reviewed the POS refund-recovery flow end to end: the new WooPosBuildRefundContent preserves selection correctly (filters preserved ids to what's still refundable, falls back to selecting all remaining), refreshRefundableItems() sources the preserved selection from either the live Content state or contentStateBeforeRefund and bypasses the loadRefundableItems early-return guard as intended, and both the preview and submission paths route OrderNotRefundable to the terminal NoRefundableItems state while mapped RefreshItems codes offer a reload instead of a retry that cannot succeed. The RefundFlowStarted analytics event is correctly gated to isFlowStart so a reload doesn't double-count, and the recovery mapping / gating is well covered by the new WooPosRefundApiErrorTest and WooPosRefundViewModelTest cases. Dropping the raw store error.message fallback in WooPosRefundSubmissionProcessor is a deliberate UX change (technical, store-locale text stays in the log) and is reflected in the updated processor tests.
PR housekeeping
- Applied repo POS guidance (AGENTS.md): plain
ViewModel+StateFlow, no store-only patterns, no Android framework imports in the ViewModel — all respected. - The
strings.xmlchange is copy-only (trailing periods + the newwoopos_refund_review_remaining_items_button); no test plan needed for the wording itself.
Automatic review · claude-opus-4-8 · Workflow run
How to reply to a finding
Reply on this review (or inline at the line the finding refers to) with one of:
@claude addressed- I made the change. Bot verifies against the next diff before marking resolved.@claude rejected: <reason>- Will not fix; reason gets quoted on the next review.@claude not-applicable- Finding does not apply (wrong file, already covered elsewhere, etc.).
The bot honours these on the next review pass.
|
👋 I won't be able to review the Android PRs until next week, can these be redirected to an Android dev? |

Description
Fixes WOOMOB-3751
The mapped refund errors always fail the same way, so the Retry we show cannot work. Each error now offers what can help:
order_not_refundable: the "nothing to refund" screen.invalid_refund_amount: no action.Unmapped create errors now show the generic message instead of the store's raw one. Copy fixes: the missing full stops, and the already-refunded message no longer claims to name one item.
iOS: woocommerce-ios#17732
Test Steps
Needs a second client (web admin) to change the order while the flow is open.
* You can also use the test store cool-shop.mystagingwebsite.com.
Images/gif
N/A
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.