Dependencystore is acting up
Posted: Wed Oct 09, 2019 4:08 pm
I have a problem with the statemachine not sending actual id's but instead phantomId:s when undoing a successor removal. (can be found here: viewtopic.php?f=52&t=12367&p=65260#p65260)
I *might* have found the problem causing this. When loading dependencies everything looks good. However there is a problem when syncing dependencies. They end up in gantt.dependencies but NOT in the dependencyStore. Why is this? Is there something off in the way the backend handles the data? I can't find a reason for this strange behaviour. See the call chain below:
Load request from client:
Load response from backend:
Sync request from client:
Sync response from backend:
I *might* have found the problem causing this. When loading dependencies everything looks good. However there is a problem when syncing dependencies. They end up in gantt.dependencies but NOT in the dependencyStore. Why is this? Is there something off in the way the backend handles the data? I can't find a reason for this strange behaviour. See the call chain below:
Load request from client:
"{\"projectId\":\"21006\",\"requestId\":\"15706288241500\",\"revision\":1,\"type\":\"load\"}"
{
"dependencies": {
"metaData": null,
"removed": null,
"rows": [],
"total": 0
},
"message": "",
"requestId": "15706288241500",
"revision": 1,
"success": true,
"tasks": {
"metaData": null,
"removed": null,
"rows": [{
"duration": 89.95833333333333,
"effort": 180,
"hierarchy": "0000",
"constraintDate": "2019-10-07T00:00:00",
"constraintType": "startnoearlierthan",
"durationUnit": "day",
"effortDriven": false,
"effortUnit": "",
"endDate": "2020-01-04T22:00:00",
"id": "1",
"manuallyScheduled": false,
"name": "Project1",
"parentId": "0",
"parentIndex": 0,
"percentDone": 0,
"referenceId": "21006",
"referenceTypeId": 0,
"referenceTypeName": "Project",
"schedulingMode": "Normal",
"showInTimeline": false,
"startDate": "2019-10-07T00:00:00",
"treeLevel": 0,
"children": [{
"duration": 89.95833333333333,
"effort": 180,
"hierarchy": "0000/0000",
"constraintDate": "2019-10-06T22:00:00",
"constraintType": "startnoearlierthan",
"durationUnit": "day",
"effortDriven": false,
"effortUnit": "hour",
"endDate": "2020-01-04T22:00:00",
"id": "2",
"manuallyScheduled": false,
"name": "Phase1",
"parentId": "1",
"parentIndex": 0,
"percentDone": 0,
"referenceId": "",
"referenceTypeName": "",
"schedulingMode": "Normal",
"showInTimeline": false,
"startDate": "2019-10-06T22:00:00",
"treeLevel": 1,
"children": [{
"duration": 90,
"hierarchy": "0000/0000/0000",
"constraintDate": "2019-10-06T22:00:00",
"constraintType": "startnoearlierthan",
"durationUnit": "day",
"effortDriven": false,
"effortUnit": "hour",
"endDate": "2020-01-04T22:00:00",
"id": "3",
"manuallyScheduled": false,
"name": "Task1",
"parentId": "2",
"parentIndex": 0,
"percentDone": 0,
"referenceId": "",
"referenceTypeName": "",
"schedulingMode": "Normal",
"showInTimeline": false,
"startDate": "2019-10-06T22:00:00",
"treeLevel": 2,
"children": []
}
]
}
]
}
],
"total": 0
},
"type": "load"
}
var gantt = Ext.fly($0).component.getGantt()
gantt.dependencies
[] <----- nothing here, ok
gantt.dependencyStore.data
[] <----- nothing here, ok
{
"type": "sync",
"requestId": "15706289539362",
"revision": 1,
"tasks": {
"added": [{
"cls": "",
"effort": 89.95833333333333,
"calendar": "_generatedClassDefEx1",
"duration": 90,
"phantomid": "_generatedClassDefEx49",
"constraintdate": "2019-10-06T20:00:00.000Z",
"constrainttype": "startnoearlierthan",
"durationunit": "day",
"iseffortdriven": false,
"effortunit": "hour",
"enddate": "2020-04-03T22:00:00.000Z",
"manuallyscheduled": false,
"elementname": "New task 1",
"parentid": "2",
"parentindex": 1,
"percentdone": 0,
"schedulingmode": "Normal",
"showintimeline": false,
"startdate": "2020-01-04T22:00:00.000Z"
}
],
"updated": [{
"effort": 179.91666666666666,
"duration": 180,
"constraintdate": "2019-10-06T22:00:00.000Z",
"enddate": "2020-04-03T22:00:00.000Z",
"elementid": "2"
}, {
"effort": 179.91666666666666,
"duration": 180,
"enddate": "2020-04-03T22:00:00.000Z",
"elementid": "1"
}
]
},
"dependencies": {
"added": [{
"cls": "",
"lag": 0,
"phantomid": "_generatedClassDefEx1",
"fromelementid": "3",
"fromside": "right",
"lagunit": "day",
"toelementid": "_generatedClassDefEx49",
"toside": "left",
"dependencytypeid": 2
}
]
},
"projectId": "21006"
}
{
"dependencies": {
"metaData": null,
"removed": [],
"rows": [{
"comment": null,
"lag": 0,
"$PhantomId": "_generatedClassDefEx1",
"bidirectional": null,
"fromEvent": "3",
"fromSide": "right",
"id": "41",
"lagUnit": "da",
"toEvent": "39",
"toSide": "left",
"type": 2
}
],
"total": 0
},
"message": "",
"requestId": "15706289539362",
"revision": 1,
"success": true,
"tasks": {
"metaData": null,
"removed": [],
"rows": [{
"duration": 90,
"effort": 89.95833333333333,
"$PhantomId": "_generatedClassDefEx49",
"constraintType": "startnoearlierthan",
"durationUnit": "day",
"effortUnit": "hour",
"endDate": "2020-04-03T22:00:00",
"id": "39",
"name": "New task 1",
"parentId": "2",
"parentIndex": 1,
"percentDone": 0,
"schedulingMode": "Normal",
"startDate": "2020-01-04T22:00:00"
}, {
"id": "1"
}, {
"id": "2"
}
],
"total": 0
}
}
gantt.dependencies
[ClassDefEx] <-------- ok, looks like the dependency was loaded correctly!
gantt.dependencyStore.data
[] <---------- The store is empty, why?