Possible bug in dhtmlxdataprocessor.js afterUpdateCallback?

Hello,

I may have found a bug in dhtmlxdata. I began investigating a problem where the onEventIdChange event was not being triggered when the event ID changed as the result of an update action. (In my use case, an updated event is assigned a new ID.) What I found was that in dhtmlxdataprocessor.js the afterUpdateCallback function does:

case "insert":
   if (tid != sid) {
      this.obj[this._methods[2]](sid, tid);
      sid = tid;
   }
   break;

but has no similar feature for the update action. While this is probably not a common scenario, it seems like the onEventIdChange should accommodate it. Adding the following in the switch(action) block of dhtmlxscheduler.js in afterUpdateCallback(…) fixed this in my testing:

case "updated":
case "update":
   if (tid != sid) {
      this.obj[this._methods[2]](sid, tid);
      sid = tid;
   }
   break;

Thanks,
Chris

Hello, Chris.

Thank you for your feedback.
I am not sure this is a bug as we are not expecting id to be changed during update operation and the same logic was coded. Though there seems to be no harm in adding that check, we will consider it.

Best regards,
Ilya