Internal links not oneboxing in private messages

I first noticed this from the private messages I received from the “Save Searches” plugin yesterday:

I thought this was simply flaky but the same happened with today’s message.


Internal links seem to onebox fine when linking in a topic/post:

Yet it failed to onebox when I just tried to link it in a private message:

The external link on the bottom worked, in contrast.

6개의 좋아요

Nice catch :wink:

https://github.com/discourse/discourse/commit/8e0da35857f56c5c5938cd5b058277814e075519

8개의 좋아요

IIRC this may have to do with a fix to a leaking problem. i.e. the public topic displayed a link to the message. Clicking the link gave the “oops or private” page, but the title of the message topic and the fact one existed was exposed. eg.

:link: Is this guy a first class numpty or what?

2개의 좋아요

Follow up question: has there been a deliberate change in how a onebox to a internal link that does not belong to the current topic renders?


i.e.

Linking a post in the current topic renders as “quote”: :white_check_mark:

Linking a post that does not belong to the current post used to render as the following:

But currently, also as a quote: (a possible :x:?)

2개의 좋아요

Yeah, since we removed the source_topic_id parameter, there’s no way for the server to know if we’re in the same topic or not anymore…

4개의 좋아요

Oh we should change this so we always use the off topic style if we must, but we can also pass in topic id with category id

4개의 좋아요

Are you saying this will be corrected or there’ll be a new way to link? Linking between topics is something we find very useful.

In fact the only thing I wish it did do that it doesn’t is to display the images in the linked post too.

1개의 좋아요

This is something @zogstrip is actively working on; he’ll update in a bit.

6개의 좋아요

There’s now a title when linking to a different topic

https://github.com/discourse/discourse/commit/60ec483caae52db3e067292a22f7bdaae7f879ca

9개의 좋아요

Quick demo/test:

A post in the current topic:

A post from another topic:

tada Thanks @zogstrip for following through with the issue!


What I see in composer preview:

What I see in the post:

Why do I feel like we have gone down some kind of rabbit hole…

2개의 좋아요

I forgot to report back here but I fixed it yesterday

https://github.com/discourse/discourse/commit/0799831dbe9014005a7e62c77c1b38b7d46e7ab7

7개의 좋아요