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.

image

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!

2 Likes

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.

3 Likes

I can’t seem to reproduce this based on this latest PR: https://github.com/discourse/discourse/pull/12063

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.

2 Likes

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

2 Likes

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:

https://github.com/discourse/discourse/commit/6d72c8ab19794c80f41fb6a77f63c1e247d3bd9b

https://github.com/discourse/discourse/commit/4af77f1e3854c564c8404e08b83e786fd25a7bfe

2 Likes

Oh I see what’s happened, this was my bad. The initial migration was not correct. You need to at least upgrade to https://github.com/discourse/discourse/commit/18da1d5b07445e1de3a1326aabcca68091093dd7 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).

3 Likes

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

2 Likes