FIX: set a correct bump timestamp when updating timestamps on a topic (PR #13746)

There was a bug with changing timestamps using the topic wrench button: Screenshot 2021-07-15 at 20 18 08

Under some circumstances, a topic was disappearing from the top of the latest tab after changing timestamps. Steps to reproduce:

  1. Choose a topic on the latest tab (the topic should be created some time ago, but has recent posts)
  2. Change topic timestamps (for example, move them one day forward):
  3. Go back to the latest tab and see that topic has disappeared.

This PR fixes this. We were setting topic.bumped_at to the timestamp user specified on the modal:

This is incorrect. Instead, we should be setting topic.bumped_at to the created_at timestamp of the last regular (not a whisper and so on) post on the topic.

GitHub

The title of this pull request changed from “FIX: set a correct bump date when updating timestamps on a topic” to "FIX: set a correct bump timestamp when updating timestamps on a topic