wordpress-mobile / WordPress-iOS

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

Comments: new posts published with the app have comments disabled even though the site discussion setting for new posts is to enable comments by default #13079

Closed designsimply closed 4 years ago

designsimply commented 4 years ago

Posts published via the app have “Allow Comments” off even though the My Sites > Settings > Discussion > Allow Comments option is toggled on.

The problem in a nutshell: up until the next to last update I was able to post from the app with comments enabled by default. Now comments posted from the app have comments disabled by default and I have to manually fix that every day.

(internal references: 14015487-hc, 2185450-zen // originally reported 2019-07-17)

Noting part of a discussion we had about this case earlier which may be helpful:

Took a quick look at the code for the v1.1 and v1.2 REST endpoints to create and update a post. A discussion parameter can be passed to enable or disable comments (among other things) but if it isn’t specified nothing specific is done. I’d assume that whatever the default is for the site would apply? I double checked the WPiOS post service and post service remote code and it doesn't look like discussion is one of the passed parameters.

(internal reference: p4a5px-2q4-p2#comment-10284 /hat tip @aerych)

Note: a few of us have tried a few times to replicate this bug but have not been able to so far.

designsimply commented 4 years ago

My comment section is not showing up on my latest blog. Can you help put it there please? I am traveling and only have the app. Don’t know what to do. Help please!!!

(internal reference: 14704540-hc)

designsimply commented 4 years ago

Why do my 'comments' section not appear when doing a post on your APP I did today’s post on my iPad this morning just like I do on my PC. The “comment” or Leave a reply did not show up. A friend told me.

(internal reference: 2467111-zen)

designsimply commented 4 years ago

The post I have just written does not have a comments box, even though I have enabled it for all of my posts automatically. This post was written in my app rather than in a browser. I am extremely frustrated by this situation, considering how fiddly it is for me to work from a browser on my phone. However, I cannot add the comments box from the app.

(internal reference: 2478038-zen)

melindahelt commented 4 years ago

WP Android 13.7 WordPress - 13.7 - Version code: 801 Android device name: Xiaomi Redmi Note 5 Pro WordPress.com Free (internal reference: 2574535-zen)

melindahelt commented 4 years ago

WordPress for iOS 13.8.1 (13.8.1.0)... Device model: iPad Mini 3 (WiFi) (iPad4,7) iOS, 12.4.4 WordPress.com Personal (internal reference 2579953-zen)

This user had a theory that the post length may be to blame here as they have written a post, previewed it and saw the comment area, then continued to write and publish and the comments not appearing.

@designsimply see mobile request post from 2019/07/19 for some previous testing - this is a follow up from the issue mentioned at the top of this thread

pmciano commented 4 years ago

WordPress for iOS 13.8.1 (13.8.1.0)... Device model: iPad11,1 (iPad11,1) iOS, 13.6 WordPress.com Personal (internal reference 2599122-zen)

User commented:

And the problem only happens about once in every 10 posts.

designsimply commented 4 years ago

Raising this one step higher in priority due to the additional user reports and noting the next iOS maintenance rotation is scheduled for Feb 17-21 and this issue will be considered for that timeframe—whether it can be worked on at that time will also depend on a triage assessment of other issues. We should do a status update at that time either way.

@melindahelt @pmciano thank you very much for including notes/re-caps alongside the zen internal references. Concise problem explanations or hints from users like the ones you've included are much appreciated!

azollafox commented 4 years ago

Once again a long post and comments disabled by default

The user in #2616672-zen has noticed that longer posts seem to be the ones with comments disabled

rfaile313 commented 4 years ago

This is a seemingly more prevalent issue every day. I'm seeing about 10 tickets per day reporting this. The workaround at this time is to turn them on for a singular post in the post settings at https://wordpress.com/posts > Enter the Post > Enter post Settings > More options > Enable Comments (under discussion) using a web browser.

rfaile313 commented 4 years ago

Some additional context from 2620127-zen

However, since the majority of all my posts have always had comments enabled, and since my settings had comments enabled when I checked them, I’m a bit concerned as to why this happened in the first place? I want to how I might prevent this happening again, and wonder if it has to do with saving in HTML mode on my phone when I want to save changes to a post? It’s the only change I’ve made recently, in order to resolve a different problem, where everything was saving locally and so didn’t show changes on the website (This apparently is a workaround!).

azollafox commented 4 years ago

This is a seemingly more prevalent issue every day.

Same! I've gotten some feedback from a user this happens to all the time that it's not the post length as he thought, but rather using the preview feature that seems to activate the issue for him.

aerych commented 4 years ago

but rather using the preview feature that seems to activate the issue for him

Oh that's interesting 🤔 Do you happen to have a ticket to share?

sophiegyo commented 4 years ago

I chatted with a user who reported this as well: 17873746-hc.

azollafox commented 4 years ago

Oh that's interesting 🤔 Do you happen to have a ticket to share?

Absolutely! This user has been keeping an eye on the bug for us :-) #2627137-zen

aerych commented 4 years ago

I tried to reproduce with an iPhone X, WPiOS v. 14 doing the following with the block editor, and old editor:

  1. I created a simple post with just a short title and one line of text in the post content.
  2. I previewed the post from within the app. I confirmed the comment box showed up in the preview.
  3. I published the post after previewing it. I also tried editing the post after previewing and then publishing.
  4. I checked the post in a browser and confirmed I could comment on it.

So it doesn't seem like I could reproduce the glitch this way. :(

rfaile313 commented 4 years ago

2633114-zen

designsimply commented 4 years ago

This issue has already been through Groundskeeping once and is on the prioritized list there still. The next opportunity we will have to look at this in Groundskeeping iOS will be Feb 17-21.

@leandroalonso does this look like something that you might be able to look into before the next Groundskeeping rotation by chance?

azollafox commented 4 years ago

Another user has another suggestion:

people tell me that they can comment on posts that don't have photos but not on posts with photos.

2613963-zen

leandroalonso commented 4 years ago

@designsimply I'm finishing the Media Editing project so I think I won't get a chance to look into it on the next few days. :(

However, I guess I might finish it by next week. Would that work?

Another option is that we have someone starting soon in our team (Jan 28), maybe this could be one of their initial tasks?

aerych commented 4 years ago

This bug vexes me so I spent a little more time on it today. It was a rabbit chase, and I'm documenting this particular hole for posterity.

According to the reports we're seeing:

  1. it happens sporadically (one user suggested 1:10)
  2. adding media, previewing the post, and the length of the post content may be a factor.
  3. its occurred with posts from both WPiOS and WPAndroid
  4. affected users are on a variety of wpcom plans and their sites use different themes

Points 1 and 2 suggest that the trigger could be something very specific to the publishing work flow--a specific step or sequence of steps that must be performed just right. This includes application behavior that is not obvious to the user, not just user initiated actions.

Point 3 suggests the cause is something common to both apps. There are enough differences between the platforms to make introducing the same glitch twice in application specific ways very unlikely, so I'd want to look to the general publishing process that's in common between the apps, something in the REST API endpoints the apps call, or in the code in mobile Gutenberg that's shared between the apps as potential causes.

Point 4 let's us rule out plan or theme specific causes. I'd have been surprised if either of these was the cause but given how difficult this glitch has been I suppose its nice to rule something out. 😛

Given the rationale above, I took another look at the API endpoint used to create a new post: v1.2/sites/%s/posts/new and v1.2/sites/%s/posts/%s. My understanding of the code* is if the discussion parameter is not set, new posts will default to the site setting, and existing posts will keep their current value. However, something that caught my attention is when the sites/%s/posts/new is called, it looks like default parameters are merged with the parameters sent with the request, but not when calling sites/%s/posts/%s. (If you go looking at the API code, look at how $input is assigned.) This makes sense as merging the default parameters could cause unintentional changes when updating only certain fields on a post.

This got me thinking, what would happen if a post was created by some other endpoint that did not load default values in a similar way? Would the discussion setting end up being disabled in this case? I explored this a bit, and I thought I'd found a potential culprit with a call to the sites/%s/posts/new endpoint made as a multi-part form request. The API would handle the input differently than if it was a JSON request and the defaults might not be loaded. Unfortunately, it looks like this is only called by the share extension and unlikely to be something all our users are doing, let alone something also done by WPAndroid. (I didn't look to see.)

As far as I know, mobile Gutenberg does not have code that would create a new post on its own (it would need auth), so unless there is some other API call the apps are making that I haven't found (nothing related in autosaves or revisions that I could see) I think this avenue is ultimately a dead end. :(

*There are gaps in my understanding of what the endpoint is doing. The culprit could still be there and I'm just not seeing it. I could also be completely off base with my theory 😬.

designsimply commented 4 years ago

@rfaile313 for the recent reports that you mentioned, can you document the following things in one comment per case?

azollafox commented 4 years ago

Got another one today. Here's what we know so far

WordPress fo iiOS 13.8.1 iOS, 13.3 iPhone 8 Plus Free Jetpack Self-Hosted Theme: Nisarg

I'm asking the 3 questions from @designsimply . Hopefully the user will get back to us. #2644002-zen

KokkieH commented 4 years ago

https://en.forums.wordpress.com/topic/comments-701/

App version: 13.9 Apple iPhone 10 IOS13.3 It’s happening for every post. With and without the preview option being used. Posts created on the app using the block editor.

Site type: WordPress.com free

azollafox commented 4 years ago

App version: 13.9 iOS, 13.3 iPad Pro 12.9-inch 3rd-gen (WiFi) (iPad8,5) Type of site (which plan?): Personal plan WordPress.com (jeremyjameshongkong.wordpress.com) Active theme: Independent Publisher 2

User did not have an answer for the last 3 Qs

2648933-zen

melindahelt commented 4 years ago

http://throughavintagedoor.com App version 13.9 Device OS version: iOS 13.3 Type of site: simple site, premium Active theme: Libretto

asking other questions

2651381-zen

oguzkocer commented 4 years ago

I am able to reliably reproduce this issue in WPAndroid with the following steps:

  1. Create a draft (type something in the editor, tap back - make sure you have internet connection so it'll upload)
  2. Go back into the draft, make a change and tap back (this will autosave a revision)
  3. Publish it

The important bit here is the fact that the post is autosaved before it's published. So, the only workaround I can think of is to always save the draft manually. (don't close the editor without saving manually) I've verified that this will prevent the issue.

I am fairly certain it's a server-side issue as I can create the draft in the app and then do the autosave and publish in Calypso and the bug will still happen. I also checked the api requests and I don't see anything wrong with them. I'll report the issue internally later today.

aerych commented 4 years ago

@oguzkocer, you get all the kudos for finding the steps to repro! All the kudos. Every. Last. One. Nice find sir!

aerych commented 4 years ago

Quick update here. I was able to reproduce the glitch in WPiOS, but the steps are slightly different from the Android app. For iOS, do the following (I used the block editor):

  1. Start a new post. Add some content and save the post as a draft.
    • 1a. Check the REST API result and confirm that comments are open.
  2. Tap to edit the draft. Add some new content and then preview the draft.
    • 2a. Check the REST API result and confirm that comments are now closed.