[IMP]Improved tests, added a new test case where we do not have task_id at all in record which came to sync, improved sync logic so that that case don't break