Bad reply links
-
Has anyone run into problems with reply links going bad?
The issue is that they use the post index, which can change for at least a few reasons:
- Users sort by different criteria
- Topic is forked
- Post is moved (for some reason, this is different than forking)
-
Yeah, I think there's a case to improve how we link to posts.
Due to the reasons you've outlined, I'm thinking it may be better to introduce some sort of linking that goes to a specific post, and always redirects you to the proper topic and post index, no matter where that post was originally.
-
@julian said in Bad reply links:
Due to the reasons you've outlined, I'm thinking it may be better to introduce some sort of linking that goes to a specific post, and always redirects you to the proper topic and post index, no matter where that post was originally.
I ran across this issue with SockBot and my admittedly less than optimally performant solution can be found here: https://github.com/SockDrawer/SockBot/blob/master/providers/nodebb/post.js#L130-L138
Basically i use the websocket method
'posts.getPost'
to get the post by postid, that gets me access to the topicid which i can use to look up the topic slug (although thanks to the topic slug correcting route i could just usetopic
as the slug), then the bit that's not terribly performant is calling'posts.getPidIndex'
with the post id and the topic id to get the post index. after that it's a bit of gluing together to create the URL.it shouldn't be too much effort to use something similar to create a
/post/postId
route that would redirect to the current location of the post. -
add /user/ and /post/ redirects · NodeBB/NodeBB@eb0aea6
Node.js based forum software built for the modern web - add /user/ and /post/ redirects · NodeBB/NodeBB@eb0aea6
GitHub (github.com)
Bad reply links
https://github.com/NodeBB/NodeBB/commit/eb0aea6390cd38c3802d070262068c676d796aaf https://community.nodebb.org/post/50068
NodeBB Community (community.nodebb.org)
-
@baris said in Bad reply links:
Bad reply links
https://github.com/NodeBB/NodeBB/commit/eb0aea6390cd38c3802d070262068c676d796aaf https://community.nodebb.org/post/50068
NodeBB Community (community.nodebb.org)
So now the "X said in..." link just needs to be updated to use that.
-
use /post/pid redirect · NodeBB/nodebb-plugin-composer-default@b76d9b3
Default Composer for NodeBB. Contribute to NodeBB/nodebb-plugin-composer-default development by creating an account on GitHub.
GitHub (github.com)
-
@boomzilla said in Bad reply links:
@baris said in Bad reply links:
Bad reply links
https://github.com/NodeBB/NodeBB/commit/eb0aea6390cd38c3802d070262068c676d796aaf https://community.nodebb.org/post/50068
NodeBB Community (community.nodebb.org)
So now the "X said in..." link just needs to be updated to use that.
Yup let's test this.