gantt.autoSchedule() reverts linked tasks

Hello all,

The issue can be reproduced here: DHTMLX Snippet Tool

Let’s say we want to modify Task #1.2 start time:

If we do it in the Timeline, and then we click autoSchedule (with specified ID), it works fine.
If we do it manually in the grid, and modify the task Start Time, and then we click autoSchedule (with specified ID), it reverts the start time back to what it was before.

Is this normal or a bug?

I would need a way to be able to automatically reschedule the Tasks when I change Start/End time manually in the grid, like it does in the Timeline.

I appreciate your time, as always.

Hello Karl,
By default, the auto-scheduling extension works in the constraint mode:
https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html#timeconstraintsfortasks

After you drag a task in the timeline, it obtains the constraint. So, the issue here is that while the task has the constraint, this is not visualized. I will add it as a bug to our internal bug tracker. The dev team will fix the issue in the future, but I cannot give you any ETA.
The issue occurs because the constraints are displayed only when the auto_scheduling config is enabled or if the show_constraints config is enabled when the auto_scheduing config is specified as an object:
https://docs.dhtmlx.com/gantt/api__gantt_auto_scheduling_config.html#:~:text=The%20auto_scheduling%20config%20can%20be%20set%20as%20a%20boolean%20or%20as%20an%20object%20to%20enable%20additional%20control%20over%20the%20auto-scheduling%20behavior.%20When%20set%20as%20an%20object%2C%20the%20following%20options%20are%20available%3A

Unfortunately, right now, the enabled property doesn’t work correctly (it is never disabled). But in the next minor update, the auto_scheduling config will always be specified as an object, so it will work correctly there.

You can see how it works with the constraints in the updated snippets:
https://snippet.dhtmlx.com/acvfj0mb

https://snippet.dhtmlx.com/cc3wfruj

When you change the dates in the grid, Gantt modifies the task constraint. You can check how it works in the official sample:
https://docs.dhtmlx.com/gantt/samples/?sample='02_extensions/19_constraints_scheduling.html'&filter=''

But it doesn’t happen if the auto_scheduling config is disabled. You need to manually change the task constraint_type from asap or alap and add the constraint_date parameter after updating a task.
Here is an example of how it can be implemented:

let updateConstraint = false
gantt.ext.inlineEditors.attachEvent("onBeforeSave", function (state) {
    if (state.columnName == "start_date") {
        updateConstraint = state.id
    }
    return true
});
gantt.attachEvent("onLightboxSave", function (id, task, is_new) {
    const originalTask = gantt.getTask(id);
    if (+originalTask.start_date !== +task.start_date ||
        +originalTask.end_date !== +task.end_date) {
        updateConstraint = id;
    }
    return true;
})

gantt.attachEvent("onAfterTaskUpdate", function (id, task) {
    if (updateConstraint && updateConstraint == id && task.constraint_type == "asap") {
        task.constraint_type = "snet"
        task.constraint_date = task.start_date
        updateConstraint = false;
        gantt.refreshTask(id)
    }
});

Here is the updated snippet:
https://snippet.dhtmlx.com/5b8u7od7