Repository navigation
Fix #25595: Locations details show all level #25961
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9064c4c
Format JetpackStats top list files with swift format
crazytonyli a3cca64
Stats: keep the selected top list options on the Show All screen
crazytonyli 3a67b95
Stats: title the Locations Show All screen with the selected level
crazytonyli 2c0889f
Stats: skip the map data request on the Show All screen
crazytonyli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
Finding from Claude:
With Regions or Cities selected, the Show All screen can show an error even though the list it needs loaded fine.
What happens
TopListViewModel.swift:180-186).countriesMapDatais read only atTopListCard.swift:110), so on Show All this request is never needed. It also has no size limit there (fetchLimit: nil).catchsetsdata = nil, and the regions list that did load is thrown away.Who is affected
Anyone who opens Show All for Regions or Cities on a slow or flaky connection. Everyone else pays for an extra request with no size limit each time the screen loads (two with a comparison period).
What they see
The error state under a "Regions" title.
Steps to reproduce
StatsService.getTopListDatathrewURLError(.timedOut)for.locations+.countries+limit == nil. Only the Show All screen sends that combination, and the regions request was left untouched.Suggested fix
Only fetch map data when the view model drives a card. For example, skip it when
fetchLimit == nil, or pass an explicit flag. Making a failed map request leavedataalone would also avoid the error state. Once that's in, the new test could assert the full request list ([.regions]on Show All) instead of.first, so a change to the map request gets caught.How this was checked
3a67b951bfon an iOS 27.2 simulator, signed in to WordPress.com. Without the temporary change, Show All for Regions loads correctly (title "Regions", region rows).[regions, countries]with limits[nil, nil], thendata == nilandloadingErrorwas set. The test is below and was not committed.Unit test used
Output:
levels=[regions, countries] limits=[nil, nil] data=nil error=NSURLErrorDomain Code=-1001