This topic will close a few seconds after the last reply

We’ve got category where topics are started with default topic timer, that closes it in 6 months.


Somehow after the update I see bug which displays “This topic will close a few seconds after the last reply.”

If I go to to wrench → topic timer the modal pops up and the message below immediately corrects itself.

Now the troubling part: I don’t see it in every topic. Some are correct some are not. Also some topics created after the update show the error (so it is probably not due to migration).

Fortunately it only displays that it will close in few seconds, in reality topics are closed on correct schedule (e.g. 6 months)

Are you able to reproduce it? Thanks in advance!


I believe @martin is currently working in this area? Any thoughts?

1 Like

Hmm that is interesting that it fixes itself when you open the modal. I will have a look into this. Also, I have a PR open to introduce a new duration component; I am glad you opened this issue because now I can also replace this:

With this:

So you do not have to do the hours → months calculation yourself.


I can’t seem to reproduce this based on this latest PR: FEATURE: Relative time input for timers and bookmarks and promote auto-close after last post timer by martin-brennan · Pull Request #12063 · discourse/discourse · GitHub

This is what I see when I make a new topic with the same settings as you:

And then when I go into the topic timer modal (I have changed this a bit with the new PR):

So maybe wait until the latest change is merged and see how you go, and if not I can investigate further. I will post back here once it is merged.


The change described above has now been merged and is in our tests-passed branch.


Thanks for your time!

I’ve done some more investigation (still on f6e6ae5e24) and found that only old topics exhibit this strange behaviour so the migration bug probably will be the case after all…

Old buggy timers have duration = 4320 and duration_minutes = NULL.
New ones working well have duration = NULL and duration_minutes = 259200

I’m suspecting one of these two commits:

FEATURE: Topic timer UI revamp (#11912) · discourse/discourse@6d72c8a · GitHub

FEATURE: Allow durations < 1 hour and < 1 day for topic timers where … · discourse/discourse@4af77f1 · GitHub


Oh I see what’s happened, this was my bad. The initial migration was not correct. You need to at least upgrade to FIX: Topic timer duration_minutes was not backfilled correctly (#12004) · discourse/discourse@18da1d5 · GitHub or the latest to fix this issue (or if you really can’t upgrade run the UPDATE queries in the post migration from the linked commit).


Cool, thanks a lot! I’ll update to latest ASAP…