[openstreetmap/openstreetmap-website] Some things you do with issues do not actually update the updated_* fields (#3211)

Andy Allan notifications at github.com
Wed Jun 9 15:02:48 UTC 2021


>     * when an issue is resolved

I've fixed this in #3217, it's a clear oversight compared to the others actions that already do this.

However, the two other situations need a bit more discussion, namely adding comments and adding new reports. In general, I don't think that we should consider the issue to be updated when a new comment is added or a new report created. I think this is similar to e.g. Diary Entries or Notes or Changesets - I would be surprised if a diary entry was shown as "updated at: now" if I happened to add a comment to a diary entry. So I think we should continue that principle, and mark the updated_at (and updated_by) for issues only if attributes of the Issue are changed.

Would you agree?

In saying that, each of those two situation **can** involve changing the attributes of the issue - due to side effects. Namely, if you add a comment and reassign the issue, that does change the one of the attributes (who it's assigned to i.e. `assigned_role`). 

Similarly, if you add a new report to a closed or ignored issue, then the issue is reopened - and that changes an attribute too (its status). The tricky bit here is who should be recorded as the updated_by - normal users don't normally show up in the list of moderators and admins as people who update or manage issues, and leaving the previous moderator or admin would get confusing since they haven't made the update. So I would suggest blanking out the updated_by if it's triggered by a new report.

So I would propose:
* Add a comment - no change
* Add a comment that reassigns the issue - change `updated_at` to now, `updated_by` to current_user
* Add a report - no change
* Add a report that changes the status of the issue - change `updated_at` to now, `updated_by` to nobody

(P.S. I still dislike this "reassign issue via a comment" nonsense, just as much as all the weirdness around NoteComments, grumble grumble)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3211#issuecomment-857773195
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20210609/22bab051/attachment-0001.htm>


More information about the rails-dev mailing list