Automatically close solved topics after N hours

AI-generated summary

The discussion centers on adding an automatic topic closure feature for solved topics after a set number of hours, proposed by adopilot. sam supports the idea and invites contributions, prompting tgxworld to implement it via a PR (#59). david raises key questions: whether unselecting a solution should cancel the timer, if unselecting after closure should reopen the topic, and whether closure should instead follow the last reply (not just solution selection). tgxworld agrees to adjust the PR to close topics N hours after the last reply if solved, and notes that unselecting a solution after closure should not reopen the topic — calling it a bug if it currently allows that. david clarifies his concern about replies continuing post-solution, but tgxworld confirms the code already accounts for this by tracking the last reply time. SidV expresses gratitude and notes the Spanish translation has been updated via PR60. The feature is well-received and nearing completion with community collaboration.

My apologies if it was mentioned already
But it will be great if we could set autoclose after X hours for resolved topics.

6 curtidas

I like this feature request and would love to add this option to the plugin. pr-welcome

5 curtidas

@tgxworld given your recent changes, how simple would it be to add this to the solved plugin?

4 curtidas

Pretty simple, just have to call topic.set_or_create_timer(TopicTimer.types[:close], SiteSetting.solved_topics_auto_close_hours) once the topic is marked as solved.

4 curtidas

PR in

https://github.com/discourse/discourse-solved/pull/59

7 curtidas

A few questions:

  • If a post is “un-selected” as the solution, will the timer be cancelled?
  • Similarly, once the topic is closed, the answer can still be “unselected” - should this make the topic re-open?
  • What if people continue replying to the topic after a solution has been chosen? Would it be better to replace “closing (n) hours after solution” with “closing (n) hours after last reply, if a solution has been chosen”?
6 curtidas

I guess it should but it’ll be tricky to implement. We’ll have to track the context in which the timer was created in and cancel timers based on that context. I’ll have a look to see what the possibility is like but I think having the admin cancel the topic timer manually should be sufficient for the first pass.

I don’t think it should auto reopen if the answer is un-selected. In fact, I think it is a bug that the answer can be unselected when the topic is already closed.

Ah yes that is a good point, I’ve updated the PR to reflect that. Thank you :thumbsup:

6 curtidas

Sorry, I realise now I wasn’t particularly clear. I was referring to the actual functionality rather than the copy. From looking at the code it seems like it’ll close the topic, even if people are still replying to it.

1 curtida

You were very clear actually :slight_smile:

I think you missed

while reading through the code. That was how the feature should have been from the start :thumbsup:

4 curtidas

Ah yes, will read more closely next time :see_no_evil:

2 curtidas

OMG … THANK YOU team for this feature !

Ps: spanish translation updated (PR60)

4 curtidas

This topic was automatically closed after 35 hours. New replies are no longer allowed.