Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Sep 4, 2025

Closes WOOMOB-16079

Description

This PR updates error handling for application password generation by catching the failure to fall back to Jetpack proxy requests. Changes include:

  • Updates RequestProcessorDelegate to remove the reason in the delegate method.
  • Updates RequestsProcessor to only notify failure of application password generation upon catching errors directly related to application password.
  • Updates AlamofireNetwork to catch AFError.requestAdaptationFailed and enable retrying requests when this error occurs.

Testing steps

Follow the instructions in TC3 and TC6 of the test plan pe5sF9-4Am-p2.

Testing information

Tested the following test cases with simulator iPhone 16 iOS 18.2.

Screenshots

No UI changes.


  • 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 4, 2025
@itsmeichigo itsmeichigo added the type: task An internally driven task. label Sep 4, 2025
@itsmeichigo itsmeichigo changed the title Attempt to fall back to Jetpack proxy after app password generation f… Attempt to fall back to Jetpack proxy after app password generation fails Sep 4, 2025
@itsmeichigo itsmeichigo changed the title Attempt to fall back to Jetpack proxy after app password generation fails Application password experiment: Fall back to Jetpack proxy after app password generation fails Sep 4, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 4, 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 Numberpr16079-0af25e0
Version23.2
Bundle IDcom.automattic.alpha.woocommerce
Commit0af25e0
Installation URL64qmsnvupk2p8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Base automatically changed from woomob-1126-direct-requests-failures to trunk September 4, 2025 10:02
@itsmeichigo itsmeichigo marked this pull request as ready for review September 4, 2025 10:19
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.

For the TC3 I got:

{
  "error": "application_passwords_disabled",
  "message": "Application passwords are not available."
}

Requests fell back to the JP proxy.

For the TC6 I got:

{
  "error": "general_error",
  "message": "Application passwords is not working."
}

The above error was returned couple times after every order lost loading attempt. I did 2 or 3 order list reloading by triggering pull-to-refresh. Then it crashed on the 3rd attempt:

Снимок экрана 2025-09-07 в 23 02 39 Снимок экрана 2025-09-07 в 23 09 20

Could be a race condition with a parallel retriedJetpackRequests object removing in separate threads. I'm able to reproduce by pull-to-refreshing dashboard and order list in parallel. Repro rate ~15%. Hard to reproduce.

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@itsmeichigo
Copy link
Contributor Author

Great catch @RafaelKayumov! It's a noob error to update those array/dictionary for error handling in different threads. I moved all error handling to a separate file and use sync access to avoid race condition. I also added tests to confirm thread safety. Let me know if you have any other suggestions!

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.

Thx!
:shipit:

@itsmeichigo itsmeichigo merged commit 636c35f into trunk Sep 9, 2025
14 checks passed
@itsmeichigo itsmeichigo deleted the woomob-1126-retry-after-password-gen-fails branch September 9, 2025 02:13
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.

5 participants