Skip to content

fix(app): report a failed review reply instead of showing success - #21089

Merged
kodjima33 merged 6 commits into
BasedHardware:mainfrom
apoorvdarshan:fix/review-reply-failure-toast
Oct 14, 2026
Merged

kodjima33 merged 6 commits into
BasedHardware:mainfrom
apoorvdarshan:fix/review-reply-failure-toast

Conversation

@apoorvdarshan

@apoorvdarshan apoorvdarshan commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

replyToAppReview reports a refused or failed owner reply by returning false; 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:

  • the dialog stays open with the typed text
  • the existing failedToSendReply error and somethingWentWrongTryAgain detail are shown, so there are no new strings
  • neither the provider nor the review is updated

The success path is unchanged. A debug-only ReviewsListPage.debugReplySenderForTest seam, gated on kDebugMode, keeps widget tests hermetic. Release and profile builds always call replyToAppReview.

test/pages/apps/reviews_list_page_reply_test.dart covers both outcomes, and its failure case fails without the fix.

Verification:

  • dart format, flutter analyze on the changed files: no issues
  • the new test plus test/widgets/app_install_flow_test.dart: 10 passed
  • git diff --check: clean

Found 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

View guided diff

claude and others added 4 commits October 10, 2026 00:42
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]>
@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Oct 9, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Reviewed the full diff — the fix and its premise check out against the code.

  • replyToAppReview (app/lib/backend/http/api/apps.dart:378) returns false on a non-200 or exception and never throws, so the old try/catch-only caller in ReviewsListPage really did treat every refused reply as success: dialog closed, local review state mutated, "Reply sent successfully" shown. The new if (!sent) branch is the correct minimal fix — it keeps the dialog and the typed text open, shows the existing failedToSendReply/somethingWentWrongTryAgain strings (no new localization keys), and skips both the AppProvider update and the review mutation. Success path unchanged.
  • The debugReplySenderForTest seam is gated on kDebugMode and @visibleForTesting, so release/profile builds always hit the real HTTP helper — same static-seam pattern already used elsewhere in app/lib/pages.
  • The new widget test is hermetic and covers both outcomes; the failure case asserts the dialog stays open, the text is preserved, and _RecordingAppProvider records no local update — exactly the regression this PR fixes.
  • Failure-class record and changelog fragment follow the existing registry/fragment conventions. Nice find (from the feat(ios): expand SwiftUI presentation with native Liquid Glass #20440 review pass).

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 need human response.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@apoorvdarshan
apoorvdarshan marked this pull request as ready for review October 11, 2026 15:34

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@apoorvdarshan apoorvdarshan added the ci:full Maintainer-granted: run full CI on this fork PR label Oct 13, 2026
apoorvdarshan and others added 2 commits October 13, 2026 23:22
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kodjima33
kodjima33 merged commit 56646d4 into BasedHardware:main Oct 14, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Maintainer-granted: run full CI on this fork PR flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants