Commit a0b304a3 authored by Aurel's avatar Aurel

index signature in syncml table when getting confirmation message so that data is not empty

as object data is stored temporarily until we get the confirmation message, syncml table was containing no data for signature
parent 33c4dc2c
......@@ -761,7 +761,6 @@ class SyncMLSubscription(XMLObject):
raise ValueError("No object retrieved althoud min/max gid (%s/%s) is provided"
% (min_gid, max_gid))
path_list = []
more_data = False
for result in object_list:
# XXX We need a way to stop the loop when we reach a given packet size
......@@ -789,8 +788,6 @@ class SyncMLSubscription(XMLObject):
temporary_data=document_data)
syncml_logger.info("Created a signature %s for gid = %s, path %s"
% (signature.getPath(), gid, document_path))
if signature:
path_list.append(signature.getPath())
more_data = self._generateSyncCommand(
action=ADD_ACTION,
signature=signature,
......@@ -810,7 +807,6 @@ class SyncMLSubscription(XMLObject):
# We need to convert XML to a CDATA type to prevent collision
# with syncml's XML
document_data = etree.CDATA(xml_string.decode('utf-8'))
path_list.append(signature.getPath())
syncml_logger.info("adding partial sync command for %s" %(gid,))
syncml_response.addSyncCommand(
sync_command=signature.getPartialAction(),
......@@ -864,7 +860,6 @@ class SyncMLSubscription(XMLObject):
continue
# Reindex modified document
path_list.append(signature.getPath())
syncml_logger.info("\tGot a diff for %s : %s" %(gid, data_diff))
more_data = self._generateSyncCommand(
action=REPLACE_ACTION,
......@@ -902,7 +897,6 @@ class SyncMLSubscription(XMLObject):
syncml_logger.info("Splitting document")
break
self.SQLCatalog_indexSyncMLDocumentList(path_list)
syncml_logger.info("_getSyncMLData end with more_data %s"
% (more_data,))
return not more_data
......
......@@ -54,6 +54,7 @@ class EngineMixin(object):
Read status (answer to command) and act according to them
"""
sync_status_counter = 0
path_list = []
for status in syncml_request.status_list:
if status["command"] == "SyncHdr": # Check for authentication
if domain.getSynchronizationState() != "initializing":
......@@ -132,6 +133,8 @@ class EngineMixin(object):
syncml_logger.info("Chunk was accepted for %s" % (object_gid,))
else:
raise ValueError("Unknown status code : %r" % (status['status_code'],))
# Index signature now to fill the data column
path_list.append(signature.getPath())
elif status['command'] == 'Delete':
sync_status_counter += 1
object_gid = status['source'] or status['target']
......@@ -149,6 +152,7 @@ class EngineMixin(object):
else:
raise ValueError("Unknown status command : %r" % (status['command'],))
domain.SQLCatalog_indexSyncMLDocumentList(path_list)
return sync_status_counter
#
......
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