Dashboard: Fix domain expiry sort crash when expiry is undefined#108645
Merged
Dashboard: Fix domain expiry sort crash when expiry is undefined#108645
Conversation
Fixes CALYPSO-2HDV Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Contributor
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dataviews library passes getValue results to field.sort, not full items. The sort function was accessing .expiry on category strings, which silently returned undefined. Fixes CALYPSO-2HDV Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fushar
approved these changes
Feb 12, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6e62e76 to
a22ab2f
Compare
fushar
reviewed
Feb 13, 2026
| * Sort comparator for nullable string field values. Null/undefined values sort | ||
| * to the end regardless of direction. | ||
| * | ||
| * Note: Despite the Field<Item> type declaring sort as (a: Item, b: Item, ...), |
Contributor
There was a problem hiding this comment.
This comment is now not necessary :)
Contributor
|
I'll commandeer this. It seems to have broken production in my case 😬 |
fushar
reviewed
Feb 13, 2026
Contributor
Author
|
Thanks. I was coming online to do so today :) |
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.
Fixes CALYPSO-2HDV
Fixes DOTMSD-1092
Proposed Changes
sortNullableStringscomparator into its own module for reuse and testability.getValueresults directly instead of accessing.expiryon them. The@wordpress/dataviewslibrary callsgetValueon each item first, then passes those results tofield.sort— the original code incorrectly treated the sort arguments as fullDomainSummaryobjects.Why are these changes being made?
The domain expiry sort in the Dashboard domains DataView was broken in two ways:
nullexpiry values, but some domains haveundefinedexpiry at runtime, causing aTypeErrorcrash (CALYPSO-2HDV — 4 occurrences, 3 users impacted).@wordpress/dataviewslibrary wrapsfield.sort— it callsgetValuefirst and passes the category strings ('1-expired','2-next-90-days','3-more-than-90-days') tosort, not fullDomainSummaryobjects. The old code dida.expiry.localeCompare(b.expiry)on these strings, which silently failed.Testing Instructions
/domains)Pre-merge Checklist