Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Sep 10, 2025

Closes WOOMOB-1315

Description

As part of the Jetpack site improvements project, we are fetching the root endpoint upon app launch and switching sites. This PR adds a similar change with Android in woocommerce/woocommerce-android#14524 PR to support the altered form of the namespace field in the response to avoid blocking the app.

Additionally, redundant observers are removed upon changes of authentication.

Testing steps

  1. Install the CoCart API plugin
  2. Open the app and sign in to the site, or switch to it (after switching to a different site)

Testing information

In trunk the above steps will lead to an error, but should succeed in this branch.

Screenshots

N/A


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added this to the 23.3 milestone Sep 10, 2025
@itsmeichigo itsmeichigo added the type: task An internally driven task. label Sep 10, 2025
@itsmeichigo itsmeichigo marked this pull request as ready for review September 10, 2025 04:25
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 10, 2025

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

App NameWooCommerce iOS Prototype
Build Numberpr16111-c7889b0
Version23.2
Bundle IDcom.automattic.alpha.woocommerce
Commitc7889b0
Installation URL6ss2iv6s3tm80
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

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

LGTM. Works as described. Namespaces arrived as dictionary and were successfully decoded/transformed into an array

/// This workaround transforms the unexpected dictionary to extract the values in the dictionary.
let namespaces = siteAPIContainer.failsafeDecodeIfPresent(
targetType: [String].self,
forKey: .namespaces, alternativeTypes: [
Copy link
Contributor

Choose a reason for hiding this comment

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

Super nit: I'd put the alternativeTypes: [ on the next line to keep the indentation consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c7889b0 👍

@itsmeichigo itsmeichigo merged commit 4f7da41 into trunk Sep 11, 2025
14 checks passed
@itsmeichigo itsmeichigo deleted the woomob-1315-improve-root-endpoint-parsing-logic branch September 11, 2025 03:09
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