-
Notifications
You must be signed in to change notification settings - Fork 16
Do not show disconnected Jetpack sites #835
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -391,7 +391,16 @@ - (NSArray *)remoteBlogsFromJSONArray:(NSArray *)jsonBlogs | |
| // Exclude deleted sites from query result, since the app does not handle deleted sites properly. | ||
| // I tried to use query arguments `site_visibility=visible` and `site_activity=active`, but neither excludes | ||
| // deleted sites. | ||
| return !blog.isDeleted; | ||
| if (blog.isDeleted) { | ||
| return false; | ||
| } | ||
|
|
||
| // Exclude sites that are connected via Jetpack, but without an active Jetpack connection. | ||
| if (blog.jetpackConnection && !blog.jetpack) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does WP.com do in the same scenario? Does it also remove the site from your account? What does "active Jetpack" mean? Can a site temporarily become inactive?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You typically get
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WP.com does not show sites with There is more complicated logic on WP.com (see here) to decide whether to show a site or not. I didn't try to understand all of them. But this PR fixes the particular case where the site domain has expired.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think that's entirely possible, like when the site is down, or for whatever reason that WP.com decides that it can't communicate with the site.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not entirely sure how the logic on WP.com translate to this: if ( hasJetpackActivePlugins( site ) && ! isJetpackSiteOrJetpackCloud( site ) ) { return false; }Is there a good way to test it?
There is also a chance the UX on WP.com isn't optimal. WP.com can't not if the site was actually deleted or if it's a temporarily issue, can it? As a user, I'd probably expect it to show some kind of a message like "site is not responding" with a way to remove it from my WP.com account. I'd also suggest moving filtering (the entire logic inside
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't follow the exact filtering logic on calypso. This is the code I referenced when looking into the API responses. // Sites connected through A4A plugin are listed on wordpress.com/sites even when Jetpack is deactivated.
export const isDisconnectedJetpackAndNotAtomic = ( site: SiteExcerptNetworkData ) => {
return ! site?.is_wpcom_atomic && site?.jetpack_connection && ! site?.jetpack;
};
Agreed. I'll do that. |
||
| return false; | ||
| } | ||
|
|
||
| return true; | ||
| }]; | ||
| } | ||
|
|
||
|
|
||
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.
Shouldn't this comment apply to the
jetpackConnectionproperty?Let's follow the Swift naming conversion and name these something like:
Indicates whether it's a Jetpack connected site.Does this mean that the site is a non-WP.com site?
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 have updated the API doc to match the properties on the HTTP API 777c651.
I believe it's possible that atomic sites have
jetpack_connection == true & jetpack == false. Just byjetpack_connectionproperty alone, we can't tell if a site is a WP.com site.