נושא זה ייסגר שניות ספורות לאחר התגובה האחרונה

סיכום מבוסס בינה מלאכותית

A bug was reported where topics with a 6-month auto-close timer incorrectly display “This topic will close a few seconds after the last reply,” despite closing on schedule. The issue appears only in older topics, not newly created ones, and resolves temporarily when opening the topic timer modal. martin investigated and confirmed the bug stems from an incorrect migration affecting the duration and duration_minutes fields in the database — older topics have duration = 43 20 and duration_minutes = NULL, while newer ones correctly use duration = NULL and duration_minutes = 259200. martin identified the root cause in a prior migration and advised upgrading to at least commit 18da1d5 or running manual SQL updates to fix affected topics. A UI improvement replacing manual hour-to-month calculations with a new duration component was also introduced in a merged PR. Overgrow confirmed the fix and plans to upgrade promptly.

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.”

image

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 לייקים

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

לייק 1

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.

4 לייקים

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.

2 לייקים

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

2 לייקים

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

2 לייקים

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).

3 לייקים

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

2 לייקים