Conversation
e120daa to
04d6c91
Compare
| @property (nonatomic, strong, readwrite, nullable) NSString *xmlrpc; | ||
| @property (nonatomic, strong, readwrite, nullable) NSString *restApiRootURL; | ||
| @property (nonatomic, strong, readwrite, nullable) NSString *apiKey; | ||
| @property (nonatomic, strong, readwrite, nonnull) NSNumber *organizationID; |
There was a problem hiding this comment.
The organizationID property is optional in the model. For simplicity, I removed the computed property.
|
|
||
| // Readonly Properties | ||
| @property (nonatomic, strong, readonly, nullable) WordPressOrgXMLRPCApi *xmlrpcApi; | ||
| @property (nonatomic, strong, readwrite, nullable) WordPressOrgXMLRPCApi *xmlrpcApi; |
There was a problem hiding this comment.
The setter will be internal again after full conversion. I'll tighten access control.
| let extra: String | ||
| if let account { | ||
| extra = " wp.com account: \(account.username ?? "") blogId: \(dotComID?.intValue ?? 0) plan: \(planTitle ?? "") (\(planID?.intValue ?? 0))" | ||
| extra = " wp.com account: \(account.username) blogId: \(dotComID?.intValue ?? 0) plan: \(planTitle ?? "") (\(planID?.intValue ?? 0))" |
There was a problem hiding this comment.
Fixing a warning introduced earlier.
| setPrimitiveValue(newValue, forKey: "xmlrpc") | ||
| didChangeValue(forKey: "xmlrpc") | ||
| // Reset the API client so next time we use the new XML-RPC URL | ||
| xmlrpcApi = nil |
There was a problem hiding this comment.
There gotta be a better way to do it...
The suggested options are (generated):
The custom accessor is only needed because of the xmlrpcApi = nil side effect. Alternatives:
- @NSManaged + didSet — doesn't work, didSet isn't supported on @NSManaged properties.
- willSave() or KVO — reset xmlrpcApi there instead. But that's more indirect and harder to follow.
- Lazy recomputation — make xmlrpcApi check if its URL still matches xmlrpc each time it's accessed, removing the need to nil it out. But that
changes Blog.m logic outside the scope of this PR.
I lean towards option 3. Wdyt?
(Not in the scope of this PR)
In general, none of this code belongs to Blog, so perhaps we could fix it by introducing a better solution for DI.
| return _selfHostedSiteRestApi; | ||
| } | ||
|
|
||
| - (BOOL)supportsRestApi { |
There was a problem hiding this comment.
This method wasn't used anymore. It's now a private property in Blog+Features.swift.
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
|
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 31226 | |
| Version | PR #25320 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 30bd29f | |
| Installation URL | 2jfhddt07cohg |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 31226 | |
| Version | PR #25320 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 30bd29f | |
| Installation URL | 7ambdqvej7b98 |





One more part that converts the computed properties. The next PR will only need to remove the lifecycle methods and the properties.