wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.98k stars 1.32k forks source link

Reader: Post comment disappears after changing the phone orientation #17114

Open vanessamaartinstt opened 2 years ago

vanessamaartinstt commented 2 years ago

Expected behavior

The comment must be posted and remain in the comment section correctly.

Actual behavior

After a fresh install, when trying to comment on a blog post from the reader the "Unable to post your comment" error message is displayed. After a few attempts, the comment is sent, but when changing the phone's orientation, the comment disappears.

Steps to reproduce the behavior

  1. Fresh install WP Android app
  2. Login
  3. Go to the reader (on any tab, I'm using Discover)
  4. Choose a post where the comment section is enabled and requires moderation
  5. Click on the balloon to add a comment
  6. Write a comment and click on the reply button
  7. Note the "Unable to post your comment" error message is displayed
  8. Try to hit the reply button a few more times until the comment gets sent
  9. Once the comment is visible on the post, change you phone orientation
  10. Note the comment is no longer visible in the comments section
  11. If you choose another post and add a comment, the "Unable to post your comment" message will no longer be displayed, it just happens in the first attempt

Videos available on GDrive

Tested on [device], Android [version], WPAndroid [version]

Motorola Moto G9 Play, Android 11, WPAndroid 20.6-rc-3

m-ubaid-77 commented 2 years ago

I debugged and observed that when user comment post a comment, it is added instantly to comments list and db as spam, after that there are two cases. 1- Comment added to local db and posted to server but if request fails due to any reason then comment get deleted from db and if user changes the orientation of goes back and come again to comment screen the newly added comment does not appears. 2- Comment posted to server successfully then its get added in db as unapproved and the query fetches only Approved comments that the reason newly added comment get disappears from screen on changing orientation or going back and come again on comments screen. Changing orientation re-fetches the data.

vanessamaartinstt commented 2 years ago

Hi @m-ubaid-77 ! Thank you for debugging this! After investigating a little further I noticed that for the case 2 on web, once the comment is successfully posted to server and gets added in db as unapproved the user is notified that the comment is awaiting for moderation. Is this possible to have a similar solution so the user have some feedback on mobile as well?

Here is a screenshot of the not-yet-approved comment on web:

Screen Shot 2022-09-11 at 13 41 49

And the same comment on mobile just doesn't appear: IMG_E26DBEDBF27C-1

m-ubaid-77 commented 2 years ago

Hi @vanessamaartinstt, Thanks for your reply, yeah we can show the unapproved comment and show a text like ("In review"/"waiting for review") , I attached an edited screenshot to demonstrate. But I used app and website and observed that unapproved commented are not getting fetched from server to either app or website, If user refresh page in app the comments disappears. Is this ok as user experience? So as these comments are not getting fetched we can not show again it would just appear once on web and if user refresh the page it would disappear also if user post a comment on web and checks on app it would not show on app until it gets approved. Here I made two video with two different behaviours, in one case it show the text that "Your comment is awaiting moderation" while in other case it do not shows message.

For now we can show unapproved comment in app with text ("Your comment is awaiting moderation" or "In review") as it gets stored in local db when user post comment from app and we can fetch it from db and it will not be disappear on rotating screen.

https://www.loom.com/share/2b3e6d2f373e4e8e9cee8c44c2b2bb63 https://www.loom.com/share/50e472fbac6643a6a646e23819c6eec5

Screenshot_20220913_115208

vanessamaartinstt commented 2 years ago

Hi again, @m-ubaid-77! Thanks for diving deeper on this!

After analyzing your videos we noticed that there are two different behaviors happening:

  1. In the first video, that the comment disappears after refreshing, the comments are closed for this post. A better behavior for Reader here (on the web and in the app) would be to state “Comments are closed” once comments are closed. I will raise another ticket for that.
  2. In the second video the comments are not closed yet, so the behavior on web Reader (“Your comment is awaiting moderation”) is what we would expect, and I think we should implement a similar “Your comment is awaiting moderation” behavior in the app.

About the comments disappearing after refreshing, in both cases, as a user I don't see it as a good experience.

Also, regarding the experience, there are three user interfaces to consider:

  1. The app > Reader experience
  2. The WordPress.com > Reader experience (ex: https://wordpress.com/read/blogs/32386031/posts/1110404046)
  3. The front-end experience of a given website (ex: https://teepee12.com/2022/09/11/printers-and-why-i-hate-them/)

In the interface 3, I was able to post a comment and see it persisting after refreshing the page, please check the video attached. That's the experience I would like to have as default regardless the platform.

One thing I was informed after raising this issue is that comments will behave differently depending on the blog’s settings, and the commenter’s relationship with the blog. For instance, most WordPress blogs (whether on WordPress.com or another host) use the default setting “before a comment appears, comment author must have a previously approved comment”. That means comments from a regular engaged reader will show up immediately, while new folks will have their comment moderated. On top of that, Akismet (the built-in spam detector that comes with all WordPress installations) will put comments straight into spam if they are very spammy. Users can decide whether the spam gets deleted immediately, or left for them to review. You can poke around inside Settings > Discussion for one of your sites to get a sense for the various ways sites control comments if it interests you!

That said, I think we will need further discussion to decide if we move forward and implement the web behavior for the app, even though it will desapear after refreshing the page, while we investigate how the comment is being persisted on the frontend experience of the site itself. What are your thoughts?

https://user-images.githubusercontent.com/107848100/191146880-8d7d2dfd-c675-41c1-b458-31aa71fbd2ba.mov