So, on our discourse server we use topic slugs like 123-region-2 this has been no issue until recently. Now it seems thats the discourse server, if it gets a request for example 5454-region-3 and that topic slug does not exist. It gets the topic with topic id 5454 and this creates a lot of problems.
Was there an update to this behaviour recently? We usually run launcher rebuild close to once a week so we have 2.3.0.beta5 right now.
Another theory might be that our 123 part in 123-region-2 is always higher than topic ids and they both have just been increasing causing no “collisions” but now that we added another region which starts of from 0 again we almost exclusively get collisions with existing topics.
Is there a way to make sure if we get http://discourse.server.com/t/123-mytopicslug-2.json and that topic does not exist we get a 404?
Starting a title with a number is a bad idea as you describe. The problem is that the slug is ignored by Discourse and that if you start a slug with a number and that number matches a topic_id you’ll get that topic.
We do this lazily, so the client predicts the topic slug. We have no way of predicting the internal discourse topic id.
So we have to get the topic solely based on the slug.
If we change the slug to be region-1-123 instead and that works I guess thats a solution. To clarify, the numbers 1 and 123 here has nothing to do with discourse and are generated elsewhere.
Or, if there is a way to get topic id by topic slug only that would be great in our case.
Renaming 37K topics could be done with a script. If you have a budget for such, post on marketplace or contact me directly.
Re-training your users to guess new URLs, which would seem much harder. But how did you train them to guess URLs in the first place? Are they coming from some other site that you manage?