Bug 1026589

Summary: Can't upload particular image to ccms using chrome
Product: [Community] PressGang CCMS Reporter: mmurray
Component: Web-UIAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.2CC: lnewson, mcaspers
Target Milestone: ---   
Target Release: 1.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-13 21:10:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Can't upload this image to ccms with chrome
none
Image that can't be uploaded in Firefox or Chrome
none
Big image
none
Really big image none

Description mmurray 2013-11-05 02:24:53 UTC
Created attachment 819463 [details]
Can't upload this image to ccms with chrome

Description of problem:
Uploading attached image results in error message with chrome (upload successful with firefox).

Error Message:
Uncaught exception was detected. Redirecting you to the home page.
Exception: (RangeError) : Maximum call stack size exceeded

Version-Release number of selected component (if applicable):
Build 201310180711

Comment 1 mmurray 2013-11-05 02:28:34 UTC
Actually, now doing an image search show that it did upload successfully despite the chrome message, return to main page and spinning wheel of doom!

Comment 2 mmurray 2013-11-21 04:54:30 UTC
Example of another image is [4271] Cen_wizoffline.png.

Comment 3 Matthew Casperson 2013-12-02 03:26:40 UTC
This is a known issue in Chrome. Firefox is unaffected. Will have to find workaround for Chrome users.

Comment 4 Lee Newson 2014-01-13 03:37:15 UTC
Created attachment 849118 [details]
Image that can't be uploaded in Firefox or Chrome

Alexandra Settle sent me this image and she wasn't able to upload it using Chrome or Firefox. I tried myself using Chrome 31 and Firefox 25 and it didn't work for me either. For reference the error on Firefox was:

Uncaught exception was detected. Redirecting you to the home page.
Exception: (RangeError) : arguments array passed to Function.prototype.apply is too large

Comment 5 Lee Newson 2014-06-25 06:58:30 UTC
Fixed in 1.8-SNAPSHOT build 201406251649.

This was actually creating the images correctly. The problem however was in our clone method when the object was returned and was attempting to be displayed.

Since chrome (and firefox on larger files) have issues copying large arrays (see https://code.google.com/p/google-web-toolkit/issues/detail?id=8239), I've altered the way we do the clone so that the byte array isn't cloned. This means that the two items will reference the same object in memory, but given that the only way we alter that value via the UI is to send new data to the REST API and then replace the old value, this isn't an issue.

Comment 6 Lee Newson 2014-07-02 01:41:04 UTC
Note: Matt has merged the changes into restyle and uploaded them to the test/development server.

Comment 7 Matthew Casperson 2014-07-02 03:21:48 UTC
Created attachment 913968 [details]
Big image

Comment 8 Matthew Casperson 2014-07-02 03:26:05 UTC
Created attachment 913969 [details]
Really big image

Comment 9 Matthew Casperson 2014-07-02 03:35:20 UTC
Confirmed that bulk image uploading and uploading individual images in Chrome and Firefox works with the supplied sample cases. I also successfully uploaded an image 1.2 MB big.

Really large images (around 6 MB) failed, but that is most likely another bug (see BZ#1112937).