Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Julius_2000 on August 07, 2023, 03:31:04 PM

Title: Moved topic message not automatically deleting
Post by: Julius_2000 on August 07, 2023, 03:31:04 PM
I've noticed that notifications of moved topics, although specified in the option before moving a topic, do not get automatically deleted from the topic index after their expiration date.

To test it I deliberately set it to 1 day a couple of times recently but nothing happens.
Title: Re: Moved topic message not automatically deleting
Post by: Kindred on August 07, 2023, 04:31:55 PM
Is the cleanup task set to run in your admin tasks?
Title: Re: Moved topic message not automatically deleting
Post by: Julius_2000 on August 07, 2023, 04:54:51 PM
Hi @Kindred,

Yes,

"Remove MOVED: redirection topics" is enabled and the next due date is tomorrow. But from experience nothing will happen.
Title: Re: Moved topic message not automatically deleting
Post by: Kindred on August 08, 2023, 08:50:23 AM
what happens if you select the "run now" checkbox and run it?
Title: Re: Moved topic message not automatically deleting
Post by: Julius_2000 on August 08, 2023, 03:27:10 PM
The "moved topic" redirect does not get removed.
Title: Re: Moved topic message not automatically deleting
Post by: Steve on August 09, 2023, 07:09:33 AM
I'm sure you know this but just in case, hard refresh in your browser?
Title: Re: Moved topic message not automatically deleting
Post by: Julius_2000 on August 09, 2023, 07:20:46 AM
Has no effect, unfortunately.
Title: Re: Moved topic message not automatically deleting
Post by: Steve on August 09, 2023, 03:58:29 PM
What about clearing forum cache and then hard refreshing? Beyond that, I'll have to have the coders take over.
Title: Re: Moved topic message not automatically deleting
Post by: shawnb61 on August 09, 2023, 05:24:33 PM
This is dependent on what you set the retention to when you moved the topic.  The redirect topics are not removed immediately - the retention period must pass.

If you set the retention to 'never', or too far out, you must delete that redirect topic manually.

I don't think the redirect expiration date is visible online...  To sneak a peek, look at the topic in phpmyadmin.

This might help:
SELECT m.subject, t.id_topic, t.redirect_expires, from_unixtime(t.redirect_expires), t.id_redirect_topic
FROM smf_topics as t
INNER JOIN smf_messages m ON t.id_first_msg = m.id_msg
WHERE LEFT(m.subject, 6) = 'MOVED:'
ORDER BY t.redirect_expires DESC, t.id_topic DESC
LIMIT 20;

Note you might have a bunch in Recycled Topics.  Note also that a redirect_expires of 0 means 'never' was selected.
Title: Re: Moved topic message not automatically deleting
Post by: Steve on August 10, 2023, 05:11:46 AM
@shawnb61 - Are you using retention date and redirect expiration date interchangeably? Is there a difference?

The OP did say he selected 1 day when he moved a topic and the redirect post did not remove itself after a day had passed.

He also said running the 'Remove MOVED: redirection topics' by clicking 'Run Now' but still the redirection topics remain.
Title: Re: Moved topic message not automatically deleting
Post by: Julius_2000 on August 10, 2023, 07:48:01 AM
Quote from: shawnb61 on August 09, 2023, 05:24:33 PMThis is dependent on what you set the retention to when you moved the topic.  The redirect topics are not removed immediately - the retention period must pass.

If you set the retention to 'never', or too far out, you must delete that redirect topic manually.

I don't think the redirect expiration date is visible online...  To sneak a peek, look at the topic in phpmyadmin.

This might help:
SELECT m.subject, t.id_topic, t.redirect_expires, from_unixtime(t.redirect_expires), t.id_redirect_topic
FROM smf_topics as t
INNER JOIN smf_messages m ON t.id_first_msg = m.id_msg
WHERE LEFT(m.subject, 6) = 'MOVED:'
ORDER BY t.redirect_expires DESC, t.id_topic DESC
LIMIT 20;

Note you might have a bunch in Recycled Topics.  Note also that a redirect_expires of 0 means 'never' was selected.
I have to contact the owner then as I can't access that myself. Like Steve said, I used the option menu to select the expiration date for the automatic removal, and also the manual removal via the Maintenance section wouldn't work. We do have lots of recycled topics, though, but I can't see an expiration setting or automatic removal option for those under Maintenance (which would also not be desired as we want to keep them as long as we like).

Quote from: Steve on August 09, 2023, 03:58:29 PMWhat about clearing forum cache and then hard refreshing? Beyond that, I'll have to have the coders take over.
Haven't tried this yet and need to check it out on our test forum.
Title: Re: Moved topic message not automatically deleting
Post by: shawnb61 on August 10, 2023, 10:56:15 AM
Quote from: Steve on August 10, 2023, 05:11:46 AM@shawnb61 - Are you using retention date and redirect expiration date interchangeably? Is there a difference?

The expiration datetime on the "MOVED:" topic is calculated based on the retention period you choose when you move the topic.   (now + retention period = expiration datetime)

Note that "one day" = 24 hours.  If you moved it with a retention of "one day" at 11pm Tuesday, its expiration datetime will be 11pm Wednesday.
Title: Re: Moved topic message not automatically deleting
Post by: Julius_2000 on August 10, 2023, 03:58:24 PM
Quote from: shawnb61 on August 10, 2023, 10:56:15 AM@shawnb61
Note that "one day" = 24 hours.  If you moved it with a retention of "one day" at 11pm Tuesday, its expiration datetime will be 11pm Wednesday.
Yes, this is how I always understood it. Which is why I waited even a little longer. But when I choose 1 day and 2, 3 days pass without the redirect being deleted, I know that the automatic deletion is not working.