Rocket.Chat Version: v54
Running Instances: 1
DB Replicaset OpLog: Enabled
Runtime_Environment
Node Version: v4.5.0
Build_Environment
Node version: v4.7.3
I noticed an odd bug that can cripple any private or group chat. I copied and pasted a message someone sent, in order to sent it to someone else. I also wrapped it in ``` to form a multi-level quote.
Reproduce this by pasting the following test and wrapping it with ``:
I ....`
When you send this, the chat page hangs and eventually you can't do anything. In Chrome it will eventually ask you to kill the page.
When you come back to RC (you'll have to manually go to a different url, such as a different dm or chat) and go back to the previous chat, it won't load or it won't let you send messages.
I was also able to reproduce this at http://demo.rocket.chat.
Confirmed this for sure brings down the browser.
```I .... ```
And it immediately locks up the entire window.
Also renders that channel completely useless until its removed directly from the db
Can reproduce with as little as ```U ..``` a single dot is no issue. 2 or more breaks it
Traced it down to: https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-markdown/markdowncode.js#L81
If you feed it: I .. doing something like: hljs.highlightAuto(('I ..')) everything locks up
Created an issue: https://github.com/isagalaev/highlight.js/issues/1505
Its been patched upstream: https://github.com/isagalaev/highlight.js/commit/d05317a8bc9ad2335bd4b7709e507314546836b1
Just need to wait on a release or reference the commit. :+1:
@geekgonecrazy We're still waiting on a release from highlight.js. How would we reference the commit?
It looks like this was fixed in 9.12.0. How long till we see that reflected in RC? Will we have to wait for a RC update?
@josephmarksjr i've updated my PR and will try and get it merged. Soon as its merged it'll be available in in develop. Then of course be available in the next release candidate and subsequent release.
This is currently biting us (I think). One of our channels is not accessible. Is there any way to manually add the needed library update on an existing release?
@tanc unfortunately its something that's compiled in on releases. Easiest way to correct this is to remove the message from the database unfortunately :(
No problem @geekgonecrazy, I managed to use the REST API to delete the latest messages on that channel which freed it up and allowed us to connect again. Thanks for fixing this issue though and look forward to the next release!
this is how we fixed it
use rocketchat
db.rocketchat_oembed_cache.count();
db.getCollection('rocketchat_oembed_cache').drop();
show collections;
db.rocketchat_message.remove({"_id": "BzRdoqy2Fec6meusS"},true);
db.rocketchat_message.find( { "_id": "BzRdoqy2Fec6meusS" } );
db.rocketchat_message.find( { rid: "u8Gg7jjTPu58JwXR7" } ).limit(10);
rs.status();
show databases;
db.migrations.find().pretty()
db.rocketchat_message.update({"_id": "96keZ44ohJKnf8i4d"}, { $set: { "msg": "deleted"}}, false, false);
For any others that find this. Please do not blindly copy and paste the above.
To fix the issue you would not need to drop oembed cache. You would have to find the offending message and prune it. using:
db.rocketchat_message.remove({"_id": "[message_id here]"},true);
Just thought I'd comment - ran into this issue today and the above helped me resolve.
My instance is running inside a docker container here are the specific steps I used:
docker exec -it <your mongoContainer> mongo
(the above launches the mongo shell from inside docker)
show databases;
use rocketchat
db.rocketchat_message.find().sort({ ts: -1 });
(the above will list new messages starting with the newest; type 'it' to page; find the _id of the bad msg)
db.rocketchat_message.find({_id: "<your message id here>"});
(the above is a good check to make sure you've got the id and syntax correct)
db.rocketchat_message.remove({_id: "<your message id here>"},true);
Hope that helps someone!
Thanks for sharing the tips!
Most helpful comment
Its been patched upstream: https://github.com/isagalaev/highlight.js/commit/d05317a8bc9ad2335bd4b7709e507314546836b1
Just need to wait on a release or reference the commit. :+1: