Unlisting a thread breaks links that have old thread names

The Bug:

A Discourse topic link looks like this:

https://meta.discourse.org/t/welcome-to-meta-discourse-org/1

Normally the title, the bit between the /t/ and /topicId at the end, does not matter, so I could change it to anything and it would still redirect to the same topic so long as the topicId is correct:

https://meta.discourse.org/t/welcome-to-hell/1

This is great behavior because if the topic’s name is changed, old links to it still work. However, this behavior is broken with unlisted threads. Unlisted threads can only be accessed with the current title, and all other links are broken – they do not redirect.

Use Case:

Our forum has community mentors that PM users to suggest how they can improve their posts. We link the threads that warrant the PMs on a spreadsheet so other mentors don’t send duplicate PMs and moderators can occasionally review us. If our site moderators unlist a thread that has had its name changed since the link was entered into the spreadsheet, the link in the spreadsheet is now broken, and the site moderators have to search all topics by the user to find the thread.

That does seem like a bug since Discourse should only care about the topic id, can you take a look @tgxworld

1 Like

I’m pretty sure this was introduced intentionally, to ensure that the URLs of unlisted topics cannot be guessed by enumerating IDs.

Update: Ah, found it:

https://meta.discourse.org/t/mod-cant-see-unlisted-posts/45549/4?u=fefrei

6 Likes

Yeah this is totally by design, I don’t see this as a bug.

There is room for improvement, however:
We could re-enable the redirect for staff users – they have visibility into unlisted topics anyways.

1 Like

Sure, I am not against that, will make this a “feature” then.

If a mod doesn’t want a thread to be visible at all, shouldn’t they just delete it? From what I understand (rather, at least what we use it for in our forum), unlisting is more for just clearing up clutter.

For instance, when we merge two threads we unlist the duplicate so we don’t have topics that pop up in the search and 5/6 of them are locked. We also unlist topics like “Look what I had for breakfast!”. If someone finds these by Id scraping, then cheers to them.

That is not the only way moderators use this, so we have to err on the side of caution.

1 Like

At the very least, it would be nice for links to redirect for unlisted topics if the name was ever valid. The server’s logic might look something like:

  • This user gave me a link. What thread does it go to?
  • I found the thread, but it’s unlisted
  • Has the title in the link the user gave me ever been the title for this topic (in edit history perhaps)?
    • Yes: Redirect to topic
    • No: Redirect to thread not found page
2 Likes

This is pretty much a GIANT enormous piece of work with perf considerations. I would be pretty strongly against it.

1 Like

I am fine with the staff improvement here, that you don’t need to know the slug of an unlisted topic if you are staff. But if that does not address Drew’s issue and Sam’s performance issue then maybe best to leave this “as designed”.

1 Like

Yeah, we are technically not staff (volunteers closer to the Regular role). A permission for trust levels or groups would cover our use case since name history isn’t performant.

A post was split to a new topic: Unlisted only means not listed in topics list

This topic was automatically closed after 4 days. New replies are no longer allowed.