Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 390045

Summary: "Import local file" with "unzip" checkbox unchecked imports the zip file but also unzips it
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: John Arthorne <john.arthorne>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 0.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
screenshot of POST requests in each case. none

Description Susan McCourt CLA 2012-09-20 14:56:04 EDT
Created attachment 221313 [details]
screenshot of POST requests in each case.

In bug 389764 I added an option in the UI to upload a zip file without unzipping it.  The idea is to provide the same options that you have in "import URL".

import from URL with zip checkbox unchecked is working as expected.  The zip file is imported as is.

In upload a file, if you unzip the zip checkbox, the zip file is imported.  But the contents are also unzipped, so you get both the zip and its contents in the folder.

The X-Xfer-Options "raw" is set in both cases.
I'm not sure if this is a client side or server side bug.
Comment 1 Susan McCourt CLA 2012-09-20 14:57:32 EDT
John, could you advise?
To try it, use the file drag and drop with a zip file, and uncheck the "unzip" box.

I'm not sure what is wrong here, it's possible I've not constructed the right request.
Comment 2 John Arthorne CLA 2012-09-21 10:00:54 EDT
Sorry it will have to be RC1.
Comment 3 John Arthorne CLA 2012-09-28 16:36:37 EDT
On Chrome 21, I am not seeing the X-Xfer-Options header when doing import local zip file with "unzip" unchecked.

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:270849
Content-Type:multipart/form-data; boundary=----WebKitFormBoundarymT0y0MQlwj5Im71h
Cookie:JSESSIONID=1v1w3odfsn2681mh241z9iw1lq
Host:localhost:8080
Origin:http://localhost:8080
Referer:http://localhost:8080/navigate/table.html
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
Comment 4 John Arthorne CLA 2012-09-28 16:40:15 EDT
Ok, the above was using the "Upload" button rather than drag & drop. With Drag & drop, I am seeing *two* POST requests in a row. The first requests raw, and the second does not. Susan can you check for a second POST request when you do it?

Request #1:
-----------

Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:270637
Content-Type:application/x-zip-compressed
Cookie:JSESSIONID=1v1w3odfsn2681mh241z9iw1lq
Host:localhost:8080
Origin:http://localhost:8080
Referer:http://localhost:8080/navigate/table.html
Slug:simon.zip
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
X-Requested-With:XMLHttpRequest
X-Xfer-Options:raw

Request #2:
-----------

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:270849
Content-Type:multipart/form-data; boundary=----WebKitFormBoundary7HFwAGpIiNH7L1rI
Cookie:JSESSIONID=1v1w3odfsn2681mh241z9iw1lq
Host:localhost:8080
Origin:http://localhost:8080
Referer:http://localhost:8080/navigate/table.html
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
Comment 5 Susan McCourt CLA 2012-10-01 13:08:37 EDT
(In reply to comment #4)
> Ok, the above was using the "Upload" button rather than drag & drop. 
Yes, this is the dojo uploader and it's a black box.  AFAICT, we can't influence the server options used here.

> With
> Drag & drop, I am seeing *two* POST requests in a row. The first requests
> raw, and the second does not. Susan can you check for a second POST request
> when you do it?

will check.
Comment 6 Susan McCourt CLA 2012-10-01 13:44:02 EDT
I'm seeing two posts as well.
At least part of the problem is a typo in the import dialog drag/drop case that has been there all along.  It had a bad loop condition and was making multiple requests.  Fixed that and pushed in
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=b3cc183c77f3655f4b89f6b368910bf1e2f62cf8

Now I can see that only one XHR call is made from the client but I'm still seeing multiple posts in the console.  Can you advise, John?  I'm not very familiar with this code...
Comment 7 John Arthorne CLA 2012-10-11 11:26:43 EDT
I spent some time debugging this yesterday but couldn't find the origin of the second post request. The first one comes from ImportDialog.js and is correct. However I noticed it is not going through the file client API here so this will only work for the "default" orion file system.

I also tried on Firefox and the bug did not occur there. I only see the double request on Chrome.
Comment 8 John Arthorne CLA 2012-10-12 13:31:32 EDT
I'm going to have to punt this one. I have done some debugging but don't know where the extra POST is coming from.
Comment 9 John Arthorne CLA 2015-05-05 15:47:13 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html
Comment 10 John Arthorne CLA 2015-05-05 16:00:52 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html