wordpress-mobile / WordPress-iOS

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

Comments: trouble saving comments while on bad network connections #11307

Open designsimply opened 5 years ago

designsimply commented 5 years ago

Steps to reproduce:

  1. Go to Notifications and tap on any comment.
  2. Throttle the network connection.*
  3. Write a reply and tap "REPLY".
  4. See a notice that says "There has been an unexpected error while sending your reply."
  5. Tap "Try Again".
  6. Return to a good network connection.
  7. Check to see whether the comment posted.

Result: comment fails to post silently and is lost.

IMG_2163 IMG_2164

Tested with WP Internal 12.0.0.20190314 on iPhone 6S iOS 12.1.4 while replying to a comment on madefortesting190318.wordpress.com which is a WordPress.com Free site.

* I throttled my network connection by going into a back room in my place where the wifi doesn't reach and is terrible. I don't have phone service connected to my iPhone so I couldn't do a wifi-to-cellular-network switch as part of the test but that may be worth trying if you have difficulty replicating the bug.

h/t @mattmiklic for the original report at p4a5px-2mi-p2.

Got a weird bug: tried to leave a comment on bad wifi, it just silently wasn’t working. Turned off WiFi to switch to LTE
Got a retry screen I missed
And this
screen-shot-2019-03-20-at-10 40 05-am
The comment appears to have been totally lost.
designsimply commented 5 years ago

I was re-checking this and I found that the comment in question actually did go through eventually at https://madefortesting190318.wordpress.com/2019/03/20/yoga-for-your-back/comment-page-1/#comment-2 ! 😱

However, the original report still stands and needs to be checked:

Got a weird bug: tried to leave a comment on bad wifi, it just silently wasn’t working. Turned off WiFi to switch to LTE
Got a retry screen I missed
And this
screen-shot-2019-03-20-at-10 40 05-am
The comment appears to have been totally lost.
yaelirub commented 5 years ago

Been trying to reproduce this issue all day and succeeded twice and only in a reply to a reply on a comment.

IMG_3586

Working with @designsimply to try and reproduce more consistently.

designsimply commented 5 years ago

I tried the same steps again, over a longer time period, trying to replicate losing a comment when posting via Notifications from a bad network connection and here's what I found:

I logged in as designsimply and using WPiOS 11.9.1 on iPhone 6S iOS 12.1.4, I left two comments last night as replies. Then I left the phone on and in an area with bad wifi and left the phone on until the morning.

For the first comment, I never saw the "Try Again" prompt and the comment has not appeared so far:

IMG_2179

For the second comment, I did see the "Try Again" prompt and tapped it and the comment published at that time with a timestamp on Mar 26 even though I created and sent the comment on Mar 25.

IMG_2181 IMG_2184

@yaelirub perhaps commenting multiple times in a row from a truly bad connection will result in the first comments from the session failing while the latest ones go through? To be honest, this feels like a very elusive bug and I'm not sure whether it can be fixed without making the whole commenting structure work offline which feels like part of project work and something to spend more time focusing on as a long-term solution compared to spending too much time here (although time spent here is really good to a point). Definitely worthy of discussion from the User Expectations team and from @elibud. Consider making that part of product work with a deadline of end of June 2019.

yaelirub commented 5 years ago

This is a difficult one to reproduce consistently but I think I got it (asking @designsimply to confirm).

  1. Turn off cellular service
  2. Turn NLC (Network Link Conditioner) on 100% loss
  3. Reply to a reply on a comment
  4. turn off wifi completely.
  5. You will see the “There was a problem” alert.
  6. Choose cancel or try again for that matter.
  7. Turn wifi on (NLC off)
  8. The comment is lost. (edited) *Sometimes the NLC stops working and so you have to turn it off, turn wifi off and on and turn the NLC on again.

So it seems like replying to a reply (couldn't reproduce consistently with replying directly to a comment) on an unstable connection and then choosing to "try again" on no connectivity will result in a comment loss.

I agree with @designsimply saying that the fix for this issue feels like part of a project work. But I have a couple of questions, @elibud :

  1. The original report states that the "There has be an unexpected error..." alert was missed. If the user hits cancel on this alert do we expect the comment to be deleted? Does cancel mean canceling the comment (as oppose to "try again")?
  2. Why are we even showing this alert? Can we remove it? imo it's not clear and the 2 options are confusing. We should "try again" for the user.
elibud commented 5 years ago

Yes, that alert is definitely confusing. If there is a common pattern we are using somewhere else let's update it to follow it. If not let's make sure we address issues like this one in the offline project.

yaelirub commented 5 years ago

https://github.com/wordpress-mobile/WordPress-iOS/pull/11817 address improving the messaging experience when replying/ commenting. This issue still remains and will be tackled in Offline support.