| Summary: | [client] fileClient service is not calling errBack when file copy or move fails | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Susan McCourt <susan> | ||||
| Component: | Client | Assignee: | John Arthorne <john.arthorne> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipse.felipe | ||||
| Version: | 0.2 | Flags: | susan:
review+
|
||||
| Target Milestone: | 0.2 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
John, can you check this out? marking RC1, it would be good to investigate this one if you have time... Created attachment 197623 [details]
Fix v01
This was just a dumb bug in the copy/move implementation. There is a helper method that implements copy/move that returns a promise. The functions that call the helper do *not* return the promise, but should. With this fix the error is being propagated to the UI for me.
+1. (I had to clear the browser cache to actually see the change). John and I discussed changing the error message to be more specific... "A file or folder with the same name already exists at this location" Fixed. |
Try to move a file onto its own parent (which should trigger an error) by doing the following: - From the navigator, select a file or folder - choose More->Move to->Choose Folder - select the current parent folder of the selected resource. There's no error shown in the UI. The client code provides an errback but it is not getting invoked. I can see in the console that the error case is detected at the server: {"HttpCode":412,"Message":"Resource cannot be overwritten","Severity":"Error","Code":0} But I don't think this is being propagated via the deferred errback. When I stepped into the fileClient code, I saw that in _doServiceCall, the success function was being called (with a result of "undefined") rather than the error function. fileService[funcName].apply(fileService, funcArgs).then( //on success, just forward the result to the client function(result) { >>>>>>> clientDeferred.callback(result); }, //on failure we might need to retry function(error) { It's possible the calling code is doing something wrong, but as best as I can tell, the problem is somewhere in the fileClient.