support
support copied to clipboard
`addTask` method should behave similar to transactional features
Current implementation with auto recording STM may lead to a problem:
- task is added, stm is still auto recording
- sync request sent
- response received and being applied
- applyProjectChanges sees STM is recording and stashes the transaction moving phantom record away. method adds new task, then stash is applied and we get duplicate.
It should probably be wrapped to a queue step and STM should be forcefully stopped at the end of the method.
Workaround:
addTask(...args) {
return this.project.queue(async () => {
const record = await this._overridden.addTask.apply(this, args);
if (this.project.stm.isRecording) {
this.project.stm.stopTransaction();
}
return record;
})
}