Skip to content

[FIX] Large files crashed browser when trying to show preview#6598

Merged
engelgabriel merged 2 commits into
developfrom
fix/dataurl-crashing-browser
Apr 5, 2017
Merged

[FIX] Large files crashed browser when trying to show preview#6598
engelgabriel merged 2 commits into
developfrom
fix/dataurl-crashing-browser

Conversation

@geekgonecrazy
Copy link
Copy Markdown
Contributor

@geekgonecrazy geekgonecrazy commented Apr 4, 2017

@RocketChat/core

We were loading every single file into memory to show a preview.

This loads only if:

  • Allowed file type
  • Not over 10MB of size ( this might should be increased... But a 100MB file crashed my browser )
  • An Image / Audio / Video file

Also if you upload a file of type other then image it'll now actually show the preview it. It was accessing file.type and file.type was empty

Closes #6534
Possibly also closes #5789

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6598 April 4, 2017 20:38 Inactive
@geekgonecrazy geekgonecrazy changed the title [FIX] Dont try and show a preview for files that are large or can't show preview [FIX] Large files crashed browser when trying to show preview Apr 4, 2017
else
callback(file, null)

formatBytes = (bytes, decimals) ->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change this function's code to tabs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed 👍

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6598 April 4, 2017 21:16 Inactive
@engelgabriel engelgabriel added this to the 0.55.0 milestone Apr 5, 2017
@engelgabriel engelgabriel merged commit 3f50288 into develop Apr 5, 2017
@engelgabriel engelgabriel deleted the fix/dataurl-crashing-browser branch April 5, 2017 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants