Skip to content

Refactor: Call processDeliveryItem only on successful checkout#243

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix-android-checkout-exception
Open

Refactor: Call processDeliveryItem only on successful checkout#243
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix-android-checkout-exception

Conversation

@sentry

@sentry sentry Bot commented Jul 23, 2026

Copy link
Copy Markdown

This PR addresses the MainFragment$BackendAPIException: Failed to init delivery workflow by modifying the Android client's checkout flow.

Previously, processDeliveryItem was called unconditionally after any HTTP response from the /checkout endpoint, including failures (e.g., 500s from the backend) or network exceptions. This led to the client throwing its own BackendAPIException even when the primary issue was a backend problem.

This change ensures that processDeliveryItem is only invoked when the HTTP checkout request returns a successful (2xx) status code. For non-successful responses or network failures, the checkout transaction is simply marked as INTERNAL_ERROR without attempting to initiate the delivery workflow.

Note: The underlying root cause of the 500 errors from the Flask backend (an UnboundLocalError due to quantities being used before assignment) is not addressed in this client-side PR. This change improves the client's resilience and error handling for such backend failures.

Fixes ANDROID-K7

@sentry
sentry Bot requested a review from sdzhong as a code owner July 23, 2026 01:41
@sentry

sentry Bot commented Jul 23, 2026

Copy link
Copy Markdown
Author

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Android com.example.vu.android 24.12.26 (241226) release
Android com.example.vu.android 24.12.26 (241226) debug
Android com.example.vu.android 24.12.26 (241226) release

⚙️ android Build Distribution Settings

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (410e6f1) to head (6a847b9).

Files with missing lines Patch % Lines
.../example/vu/android/empowerplant/MainFragment.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #243   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         16      16           
  Lines        883     886    +3     
  Branches      67      67           
=====================================
- Misses       883     886    +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant