Update wordpress-rs to 0.8.0 - #25986
Merged
Merged
Conversation
Application password created/lastUsed and user registeredDate now arrive as Date instead of strings, so drop the manual parsing.
The field is nil only for a never-published comment, which the moderation list never shows, so fall back to distantPast.
wordpress-rs 0.8.0 delivers the site-timezone date and modified fields as WpDateString instead of String.
wordpress-rs 0.8.0 moved the WordPress.com locale from per-endpoint params to a client-level language provider. Register one on both WP.com clients so responses are localized to the user's preferred language. The provider maps the language through the wordpress-rs table rather than the bundled Languages.json, so regional variants resolve and unsupported languages send no locale.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 34355 | |
| Version | PR #25986 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 4ffe4a1 | |
| Installation URL | 3eec2qad2vl10 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 34355 | |
| Version | PR #25986 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 4ffe4a1 | |
| Installation URL | 6o35ni6britjo |
jkmassel
requested changes
Sep 3, 2026
jkmassel
left a comment
Contributor
There was a problem hiding this comment.
A few things for discussion
| date = comment.dateGmt | ||
| // `dateGmt` became optional in wordpress-rs 0.8.0 (nil only for a | ||
| // never-published comment, which the moderation list never shows). | ||
| date = comment.dateGmt ?? .distantPast |
Contributor
There was a problem hiding this comment.
It seems like maybe we should make this optional instead of assigning a technically-invalid date, but WDYT?
| /// table, so regional variants such as `en-gb` resolve and unsupported languages send no locale. | ||
| final class WPComDeviceLanguageProvider: WpComLanguageProvider { | ||
| func currentLanguage() -> WpComLanguage? { | ||
| guard let identifier = Locale.preferredLanguages.first else { |
Contributor
There was a problem hiding this comment.
I wonder if we should iterate preferredLanguages and take the first match – maybe the first one doesn't resolve to a WP.com language, but the second does?
| /// | ||
| /// Reads the same source as `WordPressComRestApi` but maps it through the wordpress-rs language | ||
| /// table, so regional variants such as `en-gb` resolve and unsupported languages send no locale. | ||
| final class WPComDeviceLanguageProvider: WpComLanguageProvider { |
Contributor
There was a problem hiding this comment.
I wonder if we should've put this in wprs?
wordpress-rs 0.8.0 delivers the comment's GMT date as optional. Carry nil through CommentListItem, CommentDetail, and the detail header instead of substituting distantPast, and omit the date text in the row, author header, and info sheet when it is missing.
Walk Locale.preferredLanguages in order instead of stopping at the first entry, so a user whose top language WordPress.com does not support still gets their next preference rather than no locale.
jkmassel
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.