Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Conversation

@hichamboushaba
Copy link
Member

@hichamboushaba hichamboushaba commented Oct 11, 2024

Closes: woocommerce/woocommerce-android#12775

This PR updates the error parsing of the /connect/site-info endpoint handler to expose specific error type when the site is suspended (black-flagged).

The PR also adds a coroutine based implementation of the fetchConnectSiteInfo function.

Testing

  1. DM me to share with a suspended website (or the steps to create one)
  2. Open the example app.
  3. Tap on "Signed-out actions"
  4. Tap on "Connect site info"
  5. Enter the site URL
  6. Confirm the error: "WPCOM_SITE_SUSPENDED" is logged

@hichamboushaba hichamboushaba force-pushed the issue/12775-connect-info-error-handling branch from 9d4aee8 to 3e83534 Compare October 11, 2024 16:21
Copy link
Contributor

@JorgeMucientes JorgeMucientes left a comment

Choose a reason for hiding this comment

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

Nice work @hichamboushaba changes look good and work as expected! :shipit:

hasJetpack,
isJetpackActive,
isJetpackConnected,
isWordPressDotCom, // CHECKSTYLE IGNORE
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL about this checkstyle rule: You should not use _dotcom_, use _wpcom_ instead
I wonder if it adds any value at all

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not really sure, this code was just moved from below to be a local function.

@JorgeMucientes JorgeMucientes merged commit 5dfbbc9 into trunk Oct 16, 2024
3 checks passed
@JorgeMucientes JorgeMucientes deleted the issue/12775-connect-info-error-handling branch October 16, 2024 15:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error parsing for the WPCom endpoint /connect/site-info to allow identifying black-flagged websites.

3 participants