-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Release Notes Summary:The marshaller for Task objects do not write non existent target documents
-
Tags:
-
Sprint:nxfit 9.3.6
-
Story Points:3
Theoretically, when a document is deleted, its tasks get deleted by the DeleteTaskForDeletedDocumentListener.
Yet some cases were noticed where a task targeting a deleted document remains.
In such a case, we don't want the TaskWriter to write the document id in the "targetDocumentIds" field because the client won't know how to handle it.
The issue was seen on https://webui-demo.nuxeo.com/ on a task targeting a nonexistent document making the mobile app fail when fetching the user's tasks.
Faulty code in TaskWriter:
for (String docId : item.getTargetDocumentsIds()) { if (isFetchTargetDocumentIds) { IdRef idRef = new IdRef(docId); if (wrapper.getSession().exists(idRef)) { writeEntity(wrapper.getSession().getDocument(idRef), jg); break; } } jg.writeStartObject(); jg.writeStringField("id", docId); jg.writeEndObject(); } jg.writeEndArray();
- is related to
-
NXMOB-398 Filter workflow tasks that don't have any target document
- Resolved