wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.63k stars 1.1k forks source link

Comments are disabled on Jetpack app if not opting in for Jetpack Comments #21737

Open lastlightsnet opened 9 months ago

lastlightsnet commented 9 months ago

Initially posted on https://github.com/Automattic/jetpack/issues/33552, but I was advised to post here by @jeherve. Currently, the Jetpack app doesn't support the comment feature unless the Jetpack Comments is enabled. Personally, I don’t really like how we are (kind of) forced to activate Jetpack Comments in order to let people comment using the Jetpack app. I still want to use the default WordPress comment form on my desktop/mobile website, because I have no control over CSS used for Jetpack Comments (because CSS are within iframe). Thank you for your kind consideration.

Steps to reproduce the behavior

In Jetpack app, you see comments disabled (closed) by default if you haven't opted in to use "Jetpack Comments".

Tested on [device], iOS [version], Jetpack iOS / WordPress iOS [version]

iPhone 13, iOS version 16.6.1, Jetpack iOS version 23.2.2

aerych commented 8 months ago

Leaving from notes from slack (props @tiagomar for raising awareness)

It looks like this could be due to passing force=wpcom when querying /sites/[site]/comments I set up a test site with test content and was able to reproduce what I think the user is probably seeing (empty results in the comments view controller).

When I use the same query the app makes: v1.1/sites/225116212/comments/?locale=en&force=wpcom&number=100&status=all the API response indicates 1 record found, but the comments array is empty.

When I use the query and omit the force=wpcom parameter, I get the expected 32 comments returned. v1.1/sites/225116212/comments/?locale=en&number=100&status=all

It looks like the parameter was introduced back in 2017, possibly related to this issue and PR but I haven't been able to view the git history in WordPressKit-iOS from that far back for some reason. 🤔

We could probably resolve this by removing the force parameter assuming there's no reason to keep it at this point.

aerych commented 8 months ago

Hazarding a guess, the reason force=wpcom is being passed was possibly to make reader comments a bit snappier as it could read from the cache rather than querying the remote site. So maybe we should make the param optional, and include it for reader requests and not include it for blog requests.

aerych commented 8 months ago

As I was getting ready to merge https://github.com/wordpress-mobile/WordPressKit-iOS/pull/643 I did a final round of testing for paranoia sake and I noticed something interesting that I missed before:

When I query v1.1/sites/[jetpack-site]/comments/?locale=en&number=100&status=all each comment returned has 14 keys. However, when I query v1.1/sites/[wpcom-site]/comments/?locale=en&number=100&status=all each comment has 16 keys. The two extra keys are i_liked and like_count and that got me wondering if having these two fields was the original reason for including the force=wpcom query parameter.

Jetpack on my test site was not configured to include the like button, so I enabled that setting to see if the fields would show up in the API results. When I query v1.1/sites/[jetpack-site]/comments/?locale=en&number=100&status=all comments still contain 14 keys, however if I add back the force=wpcom query parameter not only does the query work (!) it does include the two extra keys.

This seems like something that should to be addressed at the API or plugin level after all. Since the issue seems tied to the like feature being enabled I'm thinking the right place to start looking would be with the plugin so let's reopen the original issue in the Jetpack repo and go from there.

In the short term, @lastlightsnet, you might try toggling Jetpack > Settings > Discussion > Enable Comment Likes as a work around.

Interestingly, it seems that once comment likes are enabled and used at least once the feature can be disabled again and the api endpoint will continue to work as expected.

aerych commented 8 months ago

Comment on the Jetpack issue sharing findings https://github.com/Automattic/jetpack/issues/33552#issuecomment-1806432739

lastlightsnet commented 7 months ago

In the short term, @lastlightsnet, you might try toggling Jetpack > Settings > Discussion > Enable Comment Likes as a work around.

Thank you for getting back to me. So, this means that I can use WordPress default comment (disabling Jetpack Comments) and still let people comment on my posts using Jetpack app as long as "Enable Comment Likes" is turned on? Thank you in advance.

aerych commented 7 months ago

So, this means that I can use WordPress default comment (disabling Jetpack Comments) and still let people comment on my posts using Jetpack app as long as "Enable Comment Likes" is turned on?

This is a theory we have. I've had success with these steps on a test site. I'm not sure if it's going to be true in all cases or if it was something particular to my test site. If you could give it a try and let us know we'd be interested to hear if it worked for you! :)

bobmatyas commented 5 months ago

We have two additional requests for this on:

DebbieTheDoglady commented 5 months ago

So, this means that I can use WordPress default comment (disabling Jetpack Comments) and still let people comment on my posts using Jetpack app as long as "Enable Comment Likes" is turned on?

This is a theory we have. I've had success with these steps on a test site. I'm not sure if it's going to be true in all cases or if it was something particular to my test site. If you could give it a try and let us know we'd be interested to hear if it worked for you! :)

@aerych, I use WordPress default comments and have "Enable Comment Likes" turned on, but my Jetpack app still says comments are closed. ☹️

lastlightsnet commented 5 months ago

@aerych, sorry for the late response, but it's not working (comments are still closed on Jetpack app even when turning "Enable Comment Likes" on). Hopefully, you can remove the prerequisite of opting in for Jetpack Comments to let visitors comment using Jetpack app. Thank you for your consideration.

alinclamba commented 1 month ago

Another report here:

https://wordpress.org/support/topic/latest-update-to-ios-app-wont-allow-scheduling-of-posts/#post-17809599