Commit 11be241f authored by Tristan Cavelier's avatar Tristan Cavelier

Fix bugs: dav storage, conflict manager storage

GetDocumentList from conflict or dav with no document never calls fail or done
parent cb2549b3
...@@ -448,7 +448,11 @@ var newDAVStorage = function ( spec, my ) { ...@@ -448,7 +448,11 @@ var newDAVStorage = function ( spec, my ) {
'D\\:response, response' 'D\\:response, response'
); );
var len = response.length; var len = response.length;
am.wait(o,'success',len-2); if (len === 1) {
return am.call(o,'success');
} else {
am.wait(o,'success',len-2);
}
response.each( function(i,data){ response.each( function(i,data){
if(i>0) { // exclude parent folder if(i>0) { // exclude parent folder
file = {}; file = {};
...@@ -1795,6 +1799,7 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -1795,6 +1799,7 @@ var newConflictManagerStorage = function ( spec, my ) {
}; };
o.filterTheList = function (result) { o.filterTheList = function (result) {
var i; var i;
success_max ++;
for (i = 0; i < result.length; i+= 1) { for (i = 0; i < result.length; i+= 1) {
var splitname = result[i].name.split('.') || []; var splitname = result[i].name.split('.') || [];
if (splitname.length > 0 && if (splitname.length > 0 &&
...@@ -1804,6 +1809,7 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -1804,6 +1809,7 @@ var newConflictManagerStorage = function ( spec, my ) {
am.call(o,'loadMetadataFile',[splitname.join('.')]); am.call(o,'loadMetadataFile',[splitname.join('.')]);
} }
} }
am.call(o,'success');
}; };
o.loadMetadataFile = function (path) { o.loadMetadataFile = function (path) {
priv.getDistantMetadata ( priv.getDistantMetadata (
......
This diff is collapsed.
...@@ -566,6 +566,7 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -566,6 +566,7 @@ var newConflictManagerStorage = function ( spec, my ) {
}; };
o.filterTheList = function (result) { o.filterTheList = function (result) {
var i; var i;
success_max ++;
for (i = 0; i < result.length; i+= 1) { for (i = 0; i < result.length; i+= 1) {
var splitname = result[i].name.split('.') || []; var splitname = result[i].name.split('.') || [];
if (splitname.length > 0 && if (splitname.length > 0 &&
...@@ -575,6 +576,7 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -575,6 +576,7 @@ var newConflictManagerStorage = function ( spec, my ) {
am.call(o,'loadMetadataFile',[splitname.join('.')]); am.call(o,'loadMetadataFile',[splitname.join('.')]);
} }
} }
am.call(o,'success');
}; };
o.loadMetadataFile = function (path) { o.loadMetadataFile = function (path) {
priv.getDistantMetadata ( priv.getDistantMetadata (
......
...@@ -215,7 +215,11 @@ var newDAVStorage = function ( spec, my ) { ...@@ -215,7 +215,11 @@ var newDAVStorage = function ( spec, my ) {
'D\\:response, response' 'D\\:response, response'
); );
var len = response.length; var len = response.length;
am.wait(o,'success',len-2); if (len === 1) {
return am.call(o,'success');
} else {
am.wait(o,'success',len-2);
}
response.each( function(i,data){ response.each( function(i,data){
if(i>0) { // exclude parent folder if(i>0) { // exclude parent folder
file = {}; file = {};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment