Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Apr 5, 2017

Conversation

geekgonecrazy
Copy link
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
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
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