Commit 506f9cd6 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_core/erp5_web_renderjs_ui] jIO 3.39.0

parent 78e0420c
...@@ -10340,7 +10340,8 @@ return new Parser; ...@@ -10340,7 +10340,8 @@ return new Parser;
// ie, replication should prevent losing user data // ie, replication should prevent losing user data
// Synchronize attachments before, to ensure // Synchronize attachments before, to ensure
// all of them will be deleted too // all of them will be deleted too
var result; var result,
previous_report_length;
if (context._signature_hash_key !== undefined) { if (context._signature_hash_key !== undefined) {
if (options.conflict) { if (options.conflict) {
report.log(id, options.from_local ? LOG_FORCE_DELETE_REMOTE : report.log(id, options.from_local ? LOG_FORCE_DELETE_REMOTE :
...@@ -10354,12 +10355,21 @@ return new Parser; ...@@ -10354,12 +10355,21 @@ return new Parser;
return context._signature_sub_storage.remove(id); return context._signature_sub_storage.remove(id);
}); });
} else { } else {
previous_report_length = report._list.length;
result = repairDocumentAttachment(context, id, report) result = repairDocumentAttachment(context, id, report)
.push(function () { .push(function () {
return destination.allAttachments(id); var next_report_length = report._list.length,
}) has_error = false,
.push(function (attachment_dict) { i;
if (JSON.stringify(attachment_dict) === "{}") { // Check if there was an error during attachment replication
for (i = previous_report_length; i < next_report_length; i += 1) {
if ((report._list[i][1] === id) &&
(report._list[i][0] < 100)) {
has_error = true;
}
}
if (!has_error) {
// Attachment repication has been correctly resolved
if (options.conflict) { if (options.conflict) {
report.log(id, options.from_local ? LOG_FORCE_DELETE_REMOTE : report.log(id, options.from_local ? LOG_FORCE_DELETE_REMOTE :
LOG_FORCE_DELETE_LOCAL); LOG_FORCE_DELETE_LOCAL);
...@@ -10373,8 +10383,7 @@ return new Parser; ...@@ -10373,8 +10383,7 @@ return new Parser;
}); });
} }
report.log(id, options.from_local ? LOG_UNEXPECTED_REMOTE_ATTACHMENT : report.log(id, options.from_local ? LOG_UNEXPECTED_REMOTE_ATTACHMENT :
LOG_UNEXPECTED_LOCAL_ATTACHMENT, LOG_UNEXPECTED_LOCAL_ATTACHMENT);
JSON.stringify(attachment_dict));
}, function (error) { }, function (error) {
if ((error instanceof jIO.util.jIOError) && if ((error instanceof jIO.util.jIOError) &&
(error.status_code === 404)) { (error.status_code === 404)) {
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.64445.43971.20480</string> </value> <value> <string>977.17610.605.30924</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1562768744.52</float> <float>1563892822.4</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10340,7 +10340,8 @@ return new Parser; ...@@ -10340,7 +10340,8 @@ return new Parser;
// ie, replication should prevent losing user data // ie, replication should prevent losing user data
// Synchronize attachments before, to ensure // Synchronize attachments before, to ensure
// all of them will be deleted too // all of them will be deleted too
var result; var result,
previous_report_length;
if (context._signature_hash_key !== undefined) { if (context._signature_hash_key !== undefined) {
if (options.conflict) { if (options.conflict) {
report.log(id, options.from_local ? LOG_FORCE_DELETE_REMOTE : report.log(id, options.from_local ? LOG_FORCE_DELETE_REMOTE :
...@@ -10354,12 +10355,21 @@ return new Parser; ...@@ -10354,12 +10355,21 @@ return new Parser;
return context._signature_sub_storage.remove(id); return context._signature_sub_storage.remove(id);
}); });
} else { } else {
previous_report_length = report._list.length;
result = repairDocumentAttachment(context, id, report) result = repairDocumentAttachment(context, id, report)
.push(function () { .push(function () {
return destination.allAttachments(id); var next_report_length = report._list.length,
}) has_error = false,
.push(function (attachment_dict) { i;
if (JSON.stringify(attachment_dict) === "{}") { // Check if there was an error during attachment replication
for (i = previous_report_length; i < next_report_length; i += 1) {
if ((report._list[i][1] === id) &&
(report._list[i][0] < 100)) {
has_error = true;
}
}
if (!has_error) {
// Attachment repication has been correctly resolved
if (options.conflict) { if (options.conflict) {
report.log(id, options.from_local ? LOG_FORCE_DELETE_REMOTE : report.log(id, options.from_local ? LOG_FORCE_DELETE_REMOTE :
LOG_FORCE_DELETE_LOCAL); LOG_FORCE_DELETE_LOCAL);
...@@ -10373,8 +10383,7 @@ return new Parser; ...@@ -10373,8 +10383,7 @@ return new Parser;
}); });
} }
report.log(id, options.from_local ? LOG_UNEXPECTED_REMOTE_ATTACHMENT : report.log(id, options.from_local ? LOG_UNEXPECTED_REMOTE_ATTACHMENT :
LOG_UNEXPECTED_LOCAL_ATTACHMENT, LOG_UNEXPECTED_LOCAL_ATTACHMENT);
JSON.stringify(attachment_dict));
}, function (error) { }, function (error) {
if ((error instanceof jIO.util.jIOError) && if ((error instanceof jIO.util.jIOError) &&
(error.status_code === 404)) { (error.status_code === 404)) {
......
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