# Internal links not oneboxing in private messages

**URL:** https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602
**Category:** Bug
**Created:** [February 15, 2018, 5:37am UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602 "2018-02-15T05:37:42Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)
#### Post date: [February 15, 2018, 5:37am UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/1 "2018-02-15T05:37:42Z")

</div>

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

> ![32%20AM](https://global.discourse-cdn.com/meta/original/3X/0/9/097c371941cd6d5be88e5bfd2dbe21e449855caf.png)

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:

> [@Allow groups to be invited to topics](https://meta.discourse.org/t/rate-limiting-blocking-group-invitations-to-topics/73954/11):
>
> Here is the PR wink[https://github.com/discourse/discourse/pull/5597](https://github.com/discourse/discourse/pull/5597) I hope I didn’t miss anything… (sorry for the poor video quality, shouldn’t have saved as 480p…)

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

 ![47%20AM](https://global.discourse-cdn.com/meta/original/3X/8/5/85b17771086a5e7983f46ed18096f4d7d1a7acd2.png)

The external link on the bottom worked, in contrast.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 15, 2018, 5:15pm UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/4 "2018-02-15T17:15:18Z")

</div>

Nice catch :wink:

[https://github.com/discourse/discourse/commit/8e0da35857f56c5c5938cd5b058277814e075519](https://github.com/discourse/discourse/commit/8e0da35857f56c5c5938cd5b058277814e075519)

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [February 15, 2018, 6:05pm UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/5 "2018-02-15T18:05:31Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)
#### Post date: [February 16, 2018, 6:24pm UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/6 "2018-02-16T18:24:59Z")

</div>

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:

> [@Internal links not oneboxing in private messages](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/4):
>
> Nice catch wink[https://github.com/discourse/discourse/commit/8e0da35857f56c5c5938cd5b058277814e075519](https://github.com/discourse/discourse/commit/8e0da35857f56c5c5938cd5b058277814e075519)

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

 ![15%20PM](https://global.discourse-cdn.com/meta/original/3X/3/1/311d3801c2513ee44ef5fdbbe6d91fd39a9fb635.png)

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

> [@Creating Active Users via the API gem](https://meta.discourse.org/t/creating-active-users-via-the-api-gem/33133/37):
>
> Hmm. When I did this last week, I did the deactive, then activate thing. Adding “approved=true” is a good idea. I’m not sure that it matters unless the site requires approval, but I don’t see how it could hurt. Here’s my solution: [https://github.com/pfaffman/discourse-user-creator](https://github.com/pfaffman/discourse-user-creator)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 16, 2018, 7:01pm UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/7 "2018-02-16T19:01:28Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 16, 2018, 11:27pm UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/8 "2018-02-16T23:27:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![1101010](https://avatars.discourse-cdn.com/v4/letter/1/6de8d8/32.png) [@1101010](https://meta.discourse.org/u/1101010)
#### Post date: [February 20, 2018, 12:06am UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/9 "2018-02-20T00:06:58Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 20, 2018, 12:07am UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/10 "2018-02-20T00:07:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 20, 2018, 2:25am UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/11 "2018-02-20T02:25:00Z")

</div>

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

[https://github.com/discourse/discourse/commit/60ec483caae52db3e067292a22f7bdaae7f879ca](https://github.com/discourse/discourse/commit/60ec483caae52db3e067292a22f7bdaae7f879ca)

---

<div class="post-metadata">

### Author: ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)
#### Post date: [February 20, 2018, 3:13pm UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/12 "2018-02-20T15:13:27Z")

</div>

Quick demo/test:

A post in the current topic:

> [@Internal links not oneboxing in private messages](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/11):
>
> There’s now a title when linking to a different topic [https://github.com/discourse/discourse/commit/60ec483caae52db3e067292a22f7bdaae7f879ca](https://github.com/discourse/discourse/commit/60ec483caae52db3e067292a22f7bdaae7f879ca)

A post from another topic:

> [@Available settings for global rate limits and throttling](https://meta.discourse.org/t/global-rate-limits-and-throttling-in-discourse/78612):
>
> Discourse ships with 3 different global rate limits that can be configured by site admins. Global per-ip rate limits These limits apply to every unique IP address that hits the Discourse application. (files that are served directly from the filesystem or the CDN are excluded) By default this rate limit is enabled, you may disable it or set it to a reporting mode. DISCOURSE\_MAX\_REQS\_PER\_IP\_MODE : default block, this rate limit applies out of the box. (other options are warn, warn+block, and n…

~~tada~~ Thanks @zogstrip for following through with the issue!

* * *

What I see in composer preview:

 ![34%20AM](https://global.discourse-cdn.com/meta/original/3X/6/6/663a707b1c991165eb5e9f9182e86d18cb5fc177.png)

What I see in the post:

 ![51%20AM](https://global.discourse-cdn.com/meta/original/3X/4/7/476ccc0a03e2576a0b1f677dea18c519dd470270.png)

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

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 21, 2018, 4:29pm UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/13 "2018-02-21T16:29:33Z")

</div>

I forgot to report back here but I fixed it yesterday

[https://github.com/discourse/discourse/commit/0799831dbe9014005a7e62c77c1b38b7d46e7ab7](https://github.com/discourse/discourse/commit/0799831dbe9014005a7e62c77c1b38b7d46e7ab7)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 21, 2018, 8:06pm UTC](https://meta.discourse.org/t/internal-links-not-oneboxing-in-private-messages/80602/14 "2018-02-21T20:06:22Z")

</div>


