When I try to create a numerical tag, i.e. 2026, it works, if there isn’t a tag using same ID 2026. If that ID is in use, I get that tag instead of 2026.
I’m quite sure that is an old bug, that is fixed at some point. Or do I remember wrong and I should not use numerical tags at all
Anyway, I count that as a bug — and I would like very much use years as tags.
For example, if the tag is named 2026 and its tag ID is 3, the canonical URL should be:
/tag/2026/3
The ambiguous form is the older/legacy URL:
/tag/2026
That can be interpreted as “tag with ID 2026”, so if another tag has that ID, it may resolve to that other tag instead of the tag named 2026.
Where are you trying to use or access the tag? If the link is generated by Discourse itself, I would expect it to use the canonical /tag/:slug/:id URL. If you are typing the URL manually, using an old saved link, a custom theme/plugin link, or an imported/sidebar/custom URL, it may still be using the ambiguous legacy format and resolve to the wrong tag.
If possible, I think we should treat the :foo in /tag/:foo as always being a slug, and require the form /tag/:foo/:id for IDs, where :foo can be any character (e.g. use - when you don’t know or don’t care).
This would help for backward compatibility and also in cases when the slug in known, but not the ID, which would often be the case for tags, where the name is the commonly used reference.
IDs are really there now primarily to support localization.
Thank you for the concrete example. I was able to reproduce the problem and am working on the fix.
I noticed while testing that it would also not create numerical tags when they do not have a corresponding ID either. (e.g. try to make tag 2939858339 would just do nothing and not tag the topic with anything)