Created a Topic (using rest api) with “external_id” field
Deleted that Topic, I assume that Topic will be there in the Database but it will be hidden from users
Tried to create the Same Topic with same “external_id”, I get “External has already been taken”
If the Topic is deleted from users point of view, then the user should be able to create a new Topic with the same data, but why it is not happening there seems to be no way to use the same “external_id”. Looks like a bug.
2022/10/12 12:33:32 resp: &{Status:404 Not Found StatusCode:404 Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0 Header:map[Content-Type:[application/json; charset=utf-8] Date:[Wed, 12 Oct 2022 10:33:32 GMT] Referrer-Policy:[strict-origin-when-cross-origin] Server:[nginx] Vary:[Accept-Encoding] X-Content-Type-Options:[nosniff] X-Discourse-Route:[topics/show_by_external_id] X-Discourse-Username:[mohan43u] X-Download-Options:[noopen] X-Frame-Options:[SAMEORIGIN] X-Permitted-Cross-Domain-Policies:[none] X-Request-Id:[26b86048-937c-451c-ac0c-b23dbcd3c8ca] X-Runtime:[0.013603] X-Xss-Protection:[0]] Body:0xc000183bc0 ContentLength:-1 TransferEncoding:[] Close:false Uncompressed:true Trailer:map[] Request:0xc00030a800 TLS:0xc0000d22c0}
2022/10/12 12:33:32 req: &{Method:GET URL:https://forums.tamillinuxcommunity.org/t/external_id/7N69MKNwQAs.json Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Api-Key:[] Api-Username:[mohan43u]] Body:<nil> GetBody:<nil> ContentLength:0 TransferEncoding:[] Close:false Host:forums.tamillinuxcommunity.org Form:map[] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr: RequestURI: TLS:<nil> Cancel:<nil> Response:<nil> ctx:0xc0000260b8}
2022/10/12 12:33:32 {"errors":["The requested URL or resource could not be found."],"error_type":"not_found"}
2022/10/12 12:33:32 uploading https://www.youtube.com/watch?v=7N69MKNwQAs
2022/10/12 12:33:32 {"title":"[Youtube] ஆண்ட்ராய்டுக்கான கட்டற்ற மென்பொருள் | FOSS for Android | F-Droid | Tamil","raw":"https://www.youtube.com/watch?v=7N69MKNwQAs\nஇந்த காணொளியில் F-Droid எவ்வாறு பயன்படுத்துவது? அதன் பயன் என்ன ? - என்பதை காண்போம்.\n\nகாணொளி வழங்கியவர்: \nமணிமாறன், விழுப்புரம் கட்டற்ற மென்பொருள் குழுமம்\n\nF-Droid: http://fdroid.org/\n\n#fdroid #fossforandroid #tamil #android #vglug","category":3,"external_id":"7N69MKNwQAs"}
2022/10/12 12:33:33 failed to create Topic: https://www.youtube.com/watch?v=7N69MKNwQAs
2022/10/12 12:33:33 err: <nil>
2022/10/12 12:33:33 resp: &{Status:422 Unprocessable Entity StatusCode:422 Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0 Header:map[Cache-Control:[no-cache, no-store] Content-Type:[application/json; charset=utf-8] Date:[Wed, 12 Oct 2022 10:33:33 GMT] Referrer-Policy:[strict-origin-when-cross-origin] Server:[nginx] X-Content-Type-Options:[nosniff] X-Discourse-Route:[posts/create] X-Discourse-Username:[mohan43u] X-Download-Options:[noopen] X-Frame-Options:[SAMEORIGIN] X-Permitted-Cross-Domain-Policies:[none] X-Request-Id:[217f7585-269a-48b3-ac5e-215e02e76bdb] X-Runtime:[0.060606] X-Xss-Protection:[0]] Body:{cs:0xc00032c180} ContentLength:-1 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000352100 TLS:0xc0000d22c0}
2022/10/12 12:33:33 req: &{Method:POST URL:https://forums.tamillinuxcommunity.org/posts.json Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Api-Key:[] Api-Username:[mohan43u] Content-Type:[application/json]] Body:0xc0005b0228 GetBody:0x6b0e40 ContentLength:733 TransferEncoding:[] Close:false Host:forums.tamillinuxcommunity.org Form:map[] PostForm:map[] MultipartForm:<nil> Trailer:map[] RemoteAddr: RequestURI: TLS:<nil> Cancel:<nil> Response:<nil> ctx:0xc0000260b8}
2022/10/12 12:33:33 {"action":"create_post","errors":["Title has already been used","External has already been taken"]}
I think what @RGJ was referring to: this isn’t a bug, since Discourse uses a “soft delete” approach by default. The external_id would be used in that context, which is by design.
The point is that such a topic can be undeleted, and in that case there would be two topics with the same external ID. The externalID is supposed to be unique, across all topics, including deleted ones. As @maiki said, this is by design.
can be undeleted? how? I too want to undelete that topic, my problem will go away. but there is no way to undelete that topic.
Either discourse should allow to use the external_id which is used on a deleted topic or it should have some way to undelete the deleted topic with that external_id. I see none of these two.
The posts above mine clearly indicate that topics can be undeleted. That you seem unable to undelete this specific topic to does not mean that this is a bug, it would be a matter of permissions or settings.
/latest?status=deleted works for me on my test site?
Ahhh, I see now. The video definitely helped. Yes, the topic title doesn’t currently appear on deleted topics from that view. This has been raised previously, but it may be worth another look.
Could you try [YourSite]/latest?status=deleted and seeing if you can access the topic from the topic list there instead?
And now I’ve found the other topic, there is also another tip to navigate to the deleted topic via your staff logs too, if that’s any help:
I think your one is hidden by the welcome topic banner CTA. Could you try hiding it in your console and seeing if the topic is behind it? (or edit the welcome topic to dismiss the banner )