Skip to content

[Log in] Parse error related to public-api.wordpress.com availability #14472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

samiuelson
Copy link
Contributor

@samiuelson samiuelson commented Aug 14, 2025

WP API (public-api.wordpress.com) availability error handling

WOOMOB-924

Description

This PR adds parsing of the API error related to *.wordpress.com resources being unavailable, which can be related to DNS service blocking the WP domain.

Steps to reproduce

In order to block public-api.wordpress.com, you can use various tools, like local DNS Service implementation or specialized apps, e.g. Rethink DNS.
Important part is to block access to *.wordpress.com domains.

Next, try to log-in to the app and notice the error message is not quite appropriate.

Testing information

  1. Block *.wordpress.com domain
  2. Try logging in to the app
  3. Verify the error message is appropriate

The tests that have been performed

Above

Images/gif

  • Before
image
  • After
image image
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@samiuelson samiuelson requested a review from Copilot August 14, 2025 16:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves error handling for WordPress.com connectivity issues during the login process by introducing a specific error type and user-friendly message when the app cannot reach public-api.wordpress.com.

Key changes:

  • Adds specific error handling for WordPress.com connectivity issues during site discovery
  • Implements logic to detect network errors related to public-api.wordpress.com
  • Provides clearer error messaging to users when WordPress.com is unreachable

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/login/src/main/res/values/strings.xml Adds new error message string for WordPress.com connectivity issues
libs/login/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java Updates error handling to show specific message for WordPress.com connectivity errors
libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/SiteStore.kt Adds new WORDPRESS_COM_CONNECTIVITY_ERROR enum value
libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/site/SiteRestClient.kt Implements detection logic for WordPress.com connectivity issues and error classification
WooCommerce/src/main/res/values/strings.xml Adds duplicate error message string for WooCommerce app
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/sitepicker/sitediscovery/SitePickerSiteDiscoveryViewModel.kt Updates error handling in site picker to use new connectivity error type

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 14, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit4423d72
Direct Downloadwoocommerce-wear-prototype-build-pr14472-4423d72.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 14, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit4423d72
Direct Downloadwoocommerce-prototype-build-pr14472-4423d72.apk

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2025

Codecov Report

❌ Patch coverage is 10.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.82%. Comparing base (4ad6488) to head (4423d72).

Files with missing lines Patch % Lines
...id/fluxc/network/rest/wpcom/site/SiteRestClient.kt 0.00% 12 Missing ⚠️
.../sitediscovery/SitePickerSiteDiscoveryViewModel.kt 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14472      +/-   ##
============================================
- Coverage     37.82%   37.82%   -0.01%     
  Complexity     9221     9221              
============================================
  Files          2004     2004              
  Lines        112928   112945      +17     
  Branches      14908    14915       +7     
============================================
+ Hits          42715    42716       +1     
- Misses        66326    66342      +16     
  Partials       3887     3887              

☔ View full report in Codecov by Sentry.
📢 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.

@samiuelson samiuelson added the type: task An internally driven task. label Aug 15, 2025
@samiuelson samiuelson added this to the 23.1 milestone Aug 15, 2025
@samiuelson samiuelson marked this pull request as ready for review August 15, 2025 12:34
@samiuelson samiuelson requested a review from malinajirka August 15, 2025 12:42
@malinajirka malinajirka self-assigned this Aug 18, 2025
Copy link
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@malinajirka malinajirka merged commit 5203744 into trunk Aug 18, 2025
19 checks passed
@malinajirka malinajirka deleted the woomob-924-misleading-error-messages-on-mobile-app-login-when-dns branch August 18, 2025 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants