# Pasting an image in one tab's composer pastes it in all open composers

**URL:** https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315
**Category:** Bug
**Created:** [27 mei 2015 om 15:28 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315 "2015-05-27T15:28:36Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![RaceProUK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raceprouk/32/115844_2.png) [@RaceProUK](https://meta.discourse.org/u/RaceProUK)
#### Post date: [27 mei 2015 om 15:28 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/1 "2015-05-27T15:28:36Z")

</div>

I’d tag this beta10, but that tag doesn’t exist yet. Thankyou @downey 😄

Anyway, if you have two tabs open, and both tabs have their composers open, pasting an image from the clipboard in one tab pastes the image in _both_ tabs’ composers.

Tested on Windows 8.1, Chrome 43; not sure if this is a Chrome thing or a Discourse thing yet.

Update: Also appears to happen on Firefox 38 on Windows 7

---

<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: [27 mei 2015 om 17:43 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/2 "2015-05-27T17:43:39Z")

</div>

Thanks for testing. I know why. It’s not related to a browser. It’s a Discourse thing 😉

Will fix it by the end of the week. Hopefully sooner.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [27 mei 2015 om 20:44 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/3 "2015-05-27T20:44:40Z")

</div>

I moved a post to a new topic: [Chrome window crashing on upload](https://meta.discourse.org/t/chrome-window-crashing-on-upload/29330)

---

<div class="post-metadata">

### Author: ![RaceProUK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raceprouk/32/115844_2.png) [@RaceProUK](https://meta.discourse.org/u/RaceProUK)
#### Post date: [27 mei 2015 om 19:40 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/4 "2015-05-27T19:40:30Z")

</div>

I just managed to repro again with a drag-and-drop instead of a paste; I guess it’s the same root cause?

---

<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: [27 mei 2015 om 19:41 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/5 "2015-05-27T19:41:23Z")

</div>

Yup. It’s not related to the way you upload.

---

<div class="post-metadata">

### Author: ![RaceProUK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raceprouk/32/115844_2.png) [@RaceProUK](https://meta.discourse.org/u/RaceProUK)
#### Post date: [27 mei 2015 om 20:28 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/6 "2015-05-27T20:28:12Z")

</div>

Out of interest, could this issue also cause a Chrome instance to crash? I’ve not been able to trigger it myself, but @yamikuronue has seen her Chrome window disappear sometimes when trying to paste an image. Since the upload/paste action is able to cross tabs, could it cross to a tab for an unrelated website, try to treat it like a Discourse tab, and trigger a browser crash as a result?

---

<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: [27 mei 2015 om 20:30 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/7 "2015-05-27T20:30:54Z")

</div>

> [@RaceProUK](#):
>
> could this issue also cause a Chrome instance to crash

I haven’t tested. It might but highly unlikely.

> [@RaceProUK](#):
>
> could it cross to a tab for an unrelated website

That’s not possible. The composers listen to the same channel via the Message Bus, that’s why they both get the uploaded file. Other sites can’t possibly be affected.

---

<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: [28 mei 2015 om 03:01 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/8 "2015-05-28T03:01:23Z")

</div>

The trick is to post `MessageBus.clientId` up to the server with the upload then you can include it in the final message. It would be nice to add clientId filtering to message bus. Eg this would be cool

```plaintext
MessageBus.publish "/some/channel/", "something", client_id: client_id

```

---

<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: [28 mei 2015 om 05:09 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/9 "2015-05-28T05:09:55Z")

</div>

Fixed per

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

and

[https://github.com/SamSaffron/message\_bus/commit/5d9eb0b61f7d230857939156da0c3dbda121b611](https://github.com/SamSaffron/message_bus/commit/5d9eb0b61f7d230857939156da0c3dbda121b611)

---

<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: [28 mei 2015 om 05:09 UTC](https://meta.discourse.org/t/pasting-an-image-in-one-tabs-composer-pastes-it-in-all-open-composers/29315/10 "2015-05-28T05:09:59Z")

</div>


