addons icon indicating copy to clipboard operation
addons copied to clipboard

Comment date is not updated after comment edit

Open ValentinaPC opened this issue 7 years ago • 17 comments

Steps to reproduce:

  1. Add a comment to a theme/add-on on Android i.e. https://addons-dev.allizom.org/en-US/android/addon/full-screen-252573/
  2. Wait a while and edit your comment

Expected results: Date of the comment is updated to the moment that the comment was edited.

Actual results: Date of the comment is not the same.

Notes/Issues: Verified on FF52(Android 6.0.1). Issue is reproducing on both dev and stage. Comment edited today: edit!UNITO-UNDERSCORE!001

┆Issue is synchronized with this Jira Task

ValentinaPC avatar Mar 13 '17 13:03 ValentinaPC

might be related to https://github.com/mozilla/addons/issues/10061

kumar303 avatar Mar 13 '17 20:03 kumar303

This is still an issue. We might want to define how we display edits vs the original comment date. E.g. I don't know that we should simply update the date display.

@pwalm Thoughts on how this should work?

muffinresearch avatar Jan 29 '18 17:01 muffinresearch

Oh, I see. We explicitly show the creation time:

https://github.com/mozilla/addons-frontend/blob/2eecafc5e7de5c5b67b45364e33fb696b270d2f3/src/amo/components/AddonReviewListItem/index.js#L198

kumar303 avatar Jan 30 '18 23:01 kumar303

Hmmm... How about: "posted 3 days ago (edited 5 mins ago)"

Repeating "ago" twice seems weird, but it works for me.

pwalm avatar Jan 31 '18 04:01 pwalm

While I’m rarely one to point to reddit as a way to do things 😅, I think their edit system works well here. They just show an asterisk next to the time posted and add a title attribute for when it was edited iirc.

I think adding a bracketed “edited” with a title attribute for more info (“last edited 5 mins ago”) would work eg: posted 3 days ago <span title=“Last edited 5 minutes ago”>(edited)</span>. It prevents the “ago” appearing twice, shows a post was edited, and preserves relative dates so it’s easy to compare creation date with last edited date.

tofumatt avatar Jan 31 '18 06:01 tofumatt

Side note: it might be worth ignoring displaying “edited” if it was edited within a few minutes of creation date as that is likely a typo fix or similar, though obviously there’s an abuse potential there. It’s small though–the developer would need to reply to a review that was entirely changed within a few minutes to look foolish. Maybe if there’s a developer reply we show a post was edited no matter what.

tofumatt avatar Jan 31 '18 06:01 tofumatt

@tofumatt Let's try the Reddit way

pwalm avatar Feb 06 '18 23:02 pwalm

I'm opening this up to contributors. I can mentor.

kumar303 avatar Dec 13 '18 16:12 kumar303

Hey guys - I have a friend whose looking to get started in open source. I'll speak to him (@kartik-budhiraja) and see if he can give this a shot!

seanprashad avatar Dec 15 '18 23:12 seanprashad

I think the code is now found here:

https://github.com/mozilla/addons-frontend/blob/26a1c76c010ec85d0f5647bed073c7e13d9d8c75/src/amo/components/AddonReviewCard/index.js#L347-L353

seanprashad avatar Dec 16 '18 02:12 seanprashad

@kumar303 I would love to work on this issue.

kartik-budhiraja avatar Dec 16 '18 05:12 kartik-budhiraja

Kumar is on PTO (aka Holidays) so we'll try to get as far as we can and leave feedback on what we've done

seanprashad avatar Dec 16 '18 05:12 seanprashad

I added Boolean (edited) property to the review type, but I am stuck on the process of updating it's value on edit, I suppose this method below is responsible for that :

https://github.com/mozilla/addons-frontend/blob/e6913b93d1345f96931861de247283a057399281/src/amo/actions/reviews.js#L704-L730

I modified it accordingly : https://github.com/kartik-budhiraja/addons-frontend/blob/dcb653486b5dfd4f5214894e9a85e41a56879bd6/src/amo/actions/reviews.js#L706-L732

It is receiving the values as expected but edited is not getting updated and always coming as false. @kumar303 can you please help me out here?

kartik-budhiraja avatar Jan 15 '19 03:01 kartik-budhiraja

Is there a PR I could look at?

kumar303 avatar Jan 15 '19 16:01 kumar303

Added PR mozilla/addons-frontend#7406 . @kumar303

kartik-budhiraja avatar Jan 16 '19 07:01 kartik-budhiraja

Thanks for all your work on this @kartik-budhiraja but upon closer inspection, I decided that this is not a good issue for us to work on at the moment (I include team members and contributors in that statement).

The reason is that the API is not returning an updated field but it should be. It's only returning a created field (which is used here). This means that we'll need an API update and that makes this issue non-trivial to work on.

This was probably the source of your confusion -- the edited field you added technically exists already but only in the database. We can't simulate this on the frontend.

kumar303 avatar Jan 22 '19 20:01 kumar303

Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDFRNT-116

KevinMind avatar May 03 '24 18:05 KevinMind