Repository navigation
fix(app): report a failed review reply instead of showing success - #21089
Conversation
Root cause: replyToAppReview reports a refused or failed owner reply by returning false; it never throws. ReviewsListPage awaited it inside a try/catch and ignored the result, so a rejected reply closed the dialog, updated the provider and the review as replied, and showed "Reply sent successfully" although nothing was stored. ReviewsListPage is the only caller in app/lib. Fix: branch on the returned bool. On false the dialog stays open with the typed text, the existing failedToSendReply feedback is shown (with the existing somethingWentWrongTryAgain detail; no ARB changes), and neither the provider nor the review is updated. The success path is unchanged. A debug-only ReviewsListPage.debugReplySenderForTest seam (kDebugMode-gated; release and profile always call replyToAppReview) lets widget tests stay hermetic. Test: test/pages/apps/reviews_list_page_reply_test.dart covers both outcomes: a true answer closes the dialog, updates the review and confirms; a false answer keeps the dialog and text, shows the error, and leaves the provider and review unreplied. With the false branch disabled the failure test fails. Verification: - dart format --line-length 120 on changed files: clean - flutter analyze on changed files: No issues found - flutter test --no-pub test/pages/apps/reviews_list_page_reply_test.dart test/widgets/app_install_flow_test.dart (imports app_detail.dart, the page's only importer): 10 passed - git diff --check: clean New failure class: .github/failure-classes/FC-refused-mutation-bool-confirmed-as-success.json. Failure-Class: new Claude-Session: https://claude.ai/code/session_017Ai9MxZpPCXaPKXTP6Z5dc Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reviewed the full diff — the fix and its premise check out against the code.
Since it's a draft I'll hold off on the formal review — when you mark it ready, this looks straightforward to approve as-is. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Solid bug fix (5/5): real root cause, regression test that fails without the fix, scoped diff, CI green. Approving; holding merge because the PR is still marked draft.
Git-on-my-level
left a comment
There was a problem hiding this comment.
Verified against head 98f04fd — the premise checks out and the fix is correct.
- app/lib/pages/apps/app_detail/reviews_list_page.dart — confirmed replyToAppReview() in app/lib/backend/http/api/apps.dart returns statusCode == 200 and converts exceptions to false, never throwing, so the old await-inside-try/catch treated every refused reply as success. The new !sent branch keeps the dialog open with the typed text, shows the existing failedToSendReply(somethingWentWrongTryAgain) error, and skips both the AppProvider update and the review.response/respondedAt mutations. The debugReplySenderForTest seam is properly fenced (kDebugMode ternary + @VisibleForTesting), so release and profile builds always call the real HTTP helper.
- app/test/pages/apps/reviews_list_page_reply_test.dart — both outcomes covered; the refused-reply case asserts no success toast, the dialog stays open with the original untrimmed text, send is re-enabled, and neither the provider nor the review is updated. _RecordingAppProvider makes the non-update observable and tearDown resets the static seam.
- app/changelog/unreleased/20261010-review-reply-failure.json — matches the existing unreleased-fragment format.
- .github/failure-classes/FC-refused-mutation-bool-confirmed-as-success.json — follows the established failure-class schema and accurately names the prevention artifact.
No new l10n keys — all three strings already exist across locales. The Dart Analyze & Tests lane was skipped on this head, so the test was verified statically; the local run reported in the description and the maintainer approval on this exact head cover execution. Thanks for the clean fix and a regression test that fails without it.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
kodjima33
left a comment
There was a problem hiding this comment.
Mobile bug fix: false-success toast on failed review reply. Root cause stated, scoped (+169-18/4 files), CI green, dedicated regression test with red-green verification. 4/5 confidence, no abuse signal — merging.
replyToAppReviewreports a refused or failed owner reply by returningfalse; it never throws.ReviewsListPage, its only caller, ignored that result. A rejected reply therefore closed the dialog, marked the review as replied and showed "Reply sent successfully", even though nothing was stored.The page now branches on the returned bool. On failure:
failedToSendReplyerror andsomethingWentWrongTryAgaindetail are shown, so there are no new stringsThe success path is unchanged. A debug-only
ReviewsListPage.debugReplySenderForTestseam, gated onkDebugMode, keeps widget tests hermetic. Release and profile builds always callreplyToAppReview.test/pages/apps/reviews_list_page_reply_test.dartcovers both outcomes, and its failure case fails without the fix.Verification:
dart format,flutter analyzeon the changed files: no issuestest/widgets/app_install_flow_test.dart: 10 passedgit diff --check: cleanFound while reviewing the iOS SwiftUI work (#20440).
Product invariants affected: none
UI-Evidence: none -- behaviour-only: the existing error toast replaces a false success toast; no layout or visual change
Failure-Class: new
New class:
FC-refused-mutation-bool-confirmed-as-success.🤖 Generated with Claude Code