Our state of the art Gantt chart


Post by Qwerty »

(Lifted up into a separate issue from here: viewtopic.php?f=52&t=14312)

Steps to Reproduce

  1. set up the following listeners

        project.on({
          load: () => {
            const stateTrackingManager = project.stm;
            stateTrackingManager.enable();
            stateTrackingManager.autoRecord = true;
        },
        sync: () => {
          console.debug(project.stm.isReady); // this line is for debugging purposes
          project.stm.resetQueue();
        }
      })
  2. create a new task in the schedule

  3. save

The issue we see is an exception:

StateBase.js:7 Uncaught (in promise) Error: Abstract method call!
    at mE (StateBase.js:7)
    at t.value (StateBase.js:75)
    at e (StateTrackingManager.js:84)
    at t.value (StateTrackingManager.js:591)
    at t.n.clearUndoStack (Toolbar.jsx:120)
    at t.value (Events.js:842)
    at t.<anonymous> (AbstractCrudManagerMixin.js:958)
    at l (runtime.js:45)
    at Generator._invoke (runtime.js:271)
    at Generator.forEach.e.<computed> [as next] (runtime.js:97)

This may or may not have anything to do with it, but it seems that after adding a new task stm.isReady returns false and we see the exception whereas after making other changes stm.isReady is true and no exception occurs.

If the state tracking manager had a waitForReady method that returned a promise similar to waitForPropagateCompleted on the project model this would potentially solve the issue.

If this is indeed an error, do you happen to have any workarounds while it gets fixed?

Thanks again.


Post by pmiklashevich »

Please see my reply in the thread you mentioned. We cannot reproduce the issue with our demo. Can you? Please submit a full runnable testcase based on one of our examples, so we can investigated the problem. Thanks!

Pavlo Miklashevych
Sr. Frontend Developer


Post by Qwerty »

Hi, thanks again for looking into this.

We ended up finding a workaround to help us move forward for the time being and we've unfortunately not yet had a chance to reproduce on example code yet.

We're definitely interested in getting to the bottom of the issue though so we'll try to get back to you in the near future.

In case you're interested, the workaround we're using is this:

clearUndoStack = () => {
  if (gantt.project.stm.isReady) {
    gantt.project.stm.resetQueue();
  } else {
    gantt.project.stm.on({
      recordingStop: this.clearUndoStack,
      once: true
    });
  }
};

Post Reply