Commit 3b3ed84b authored by Romain Courteaud's avatar Romain Courteaud

ReplicateStorage: drop attachment signature when resolved a document deletion conflict

parent acb3274d
......@@ -716,6 +716,13 @@
});
} else {
result
.push(function () {
// Drop signature if the destination document was empty
// but a signature exists
if (options.create_new_document === true) {
return context._signature_sub_storage.remove(id);
}
})
.push(function () {
return destination.put(id, doc);
})
......@@ -829,7 +836,11 @@
return propagateModification(context, source, destination, doc,
local_hash, id, skip_document_dict,
{use_post: ((options.use_post) &&
(remote_hash === null))});
(remote_hash === null)),
create_new_document:
((remote_hash === null) &&
(status_hash !== null))
});
}
// Conflict cases
......@@ -852,7 +863,9 @@
id,
skip_document_dict,
{use_post: ((options.use_revert_post) &&
(local_hash === null))}
(local_hash === null)),
create_new_document: ((local_hash === null) &&
(status_hash !== null))}
);
}
......@@ -861,7 +874,9 @@
// Copy remote modification remotely
return propagateModification(context, source, destination, doc,
local_hash, id, skip_document_dict,
{use_post: options.use_post});
{use_post: options.use_post,
create_new_document:
(status_hash !== null)});
}
doc = doc || local_hash;
remote_doc = remote_doc || remote_hash;
......
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