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

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

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

10 Likes

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

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

2 Likes

I moved a post to a new topic: Chrome window crashing on upload

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

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

2 Likes

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?

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

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.

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

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

Fixed per

https://github.com/discourse/discourse/commit/bb3fb37650e05b5087f5630a1ac0f50068b6d8c2

and

https://github.com/SamSaffron/message_bus/commit/5d9eb0b61f7d230857939156da0c3dbda121b611

4 Likes