-
Notifications
You must be signed in to change notification settings - Fork 121
Decouple application password name logic from knowing the OS #15729
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
Decouple application password name logic from knowing the OS #15729
Conversation
|
|
6a4ff81 to
d61de8c
Compare
| get async { | ||
| #if !os(watchOS) | ||
| let bundleIdentifier = Bundle.main.bundleIdentifier ?? "Unknown" | ||
| #if !os(watchOS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you mention pushing UIDevice off DefaultApplicationPasswordUseCase, I thought this check for watchOS would be removed and the usage of UIDevice below would be replaced with DeviceModelIdentifierInfo. @mokagio could you please clarify this again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @itsmeichigo . I simply did not push the rest of the work 🤦♂️
|
d61de8c to
4adfc35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested site credential login with a JN site and confirmed that the login was successful after this fix:
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-06-11.at.13.15.09.mp4
I also checked with Proxyman and confirmed that the application name was correct.
|
@itsmeichigo thank you! For what is worth, I also tested it and verified the new code gets called and the subsequent API request is successful resulting a login. |



Description
See https://linear.app/a8c/issue/AINFRA-730
Problem: When moving networking from framework to Swift package, the architecture checks no longer work. This is a problem for the current application password name logic:
woocommerce-ios/Networking/Sources/Core/ApplicationPassword/ApplicationPasswordUseCase.swift
Lines 51 to 63 in ae05dab
In practice, this means that when building the watch app we try to access
UIDevicewhich is not available.I tried replacing
#if !os(watchOS)with#if canImport(UIKit)but got the same problem, surprisingly.Solution: I pushed
UIDeviceoffDefaultApplicationPasswordUseCase, leaving it up to the caller to pass the information. This way, the iOS app target can in aDefaultApplicationPasswordUseCasewith theUIDevicedata, and the watch code is none the wiser.See also the documentation comment in the new
DeviceModelVersionInfodata transfer object.Steps to reproduce & Testing information
I'm not too sure how to test this on device, can you help me with that? Notice CI is green in the meantime.
Screenshots
RELEASE-NOTES.txtif necessary.