Our pure JavaScript Scheduler component


Post by glennvl91 »

Hi

I have a weird issue here. I work with Scheduler pro and added projectmodel for syncing with backend. Everything works fine like updates and deletes. But when I add an event, it also gets triggered and the event is created but it keeps being triggered. So the event is created multiple times.

Screenshot 2022-09-27 at 16.20.03.png
Screenshot 2022-09-27 at 16.20.03.png (58.8 KiB) Viewed 532 times

It only happens when adding an event. My projectmodel looks like this:

project : {
            // Configure urls used by the built in CrudManager
            autoLoad: true,
            autoSync: true,
            transport : {
                load : {
                    url : schedulerContainer.dataset.resourcesUrl
                },
                sync : {
                    url : schedulerContainer.dataset.syncResourcesUrl
                }
            },
            onRequestFail : (event) => {
                const
                    { requestType, response } = event,
                    serverMessage             = response && response.message,
                    exceptionText             = `Action "${requestType}" failed. ${serverMessage ? ` Server response: ${serverMessage}` : ''}`;

            Toast.show({
                html    : exceptionText,
                color   : 'b-red',
                style   : 'color:white',
                timeout : 3000
            });

            console.error(exceptionText);
        }
    },

The response the server gives after adding the event looks like this:

{ 
  "success":true,
  "resources": {
      "rows":[]
   },
   "events": {
      "rows": [
        {
          "id":"2168061_2168061",
          "startDate":"2022-09-28T19:00:00+02:00",
          "duration":180,
          "durationUnit":"m",
          "name":"cxwv araz (2)",       
"firstName":"cxwv", "surnames":"araz", "numberOfPersons":2, "comments":null, "allergies":null, "style":"border-radius:5px" } ] }, "assignments":{"rows":[ {
"id":"2168061_2168061_0", "resourceId":"2168061", "eventId":"2168061_2168061" } ] }, "dependencies":{"rows":[]}}

What can I be doing wrong? Or is it a bug in the system because it has been a problem before as I saw in other topics like viewtopic.php?f=52&t=18761
But I'm not using 'percentDone' so that can't be the problem and it also should be fixed since i'm using the newest version 5.1.3.

Thanks in advance


Post by marcio »

Hello glennvl91,

We are releasing some updates 5.1.4 (not released) and 5.2.0-alpha-1 versions that are related to that, could you please download the nightly build from the customer zone and check if that loop still happens?

Best regards,
Márcio


Post by glennvl91 »

Hi, I can't login in the customer zone because I'm still using the trial version.

Can i get this build through npm by any chance?

Thanks!


Post by marcio »

Can you try to use 5.2.0-alpha-1 from npm package? It's already released.

Best regards,
Márcio


Post by glennvl91 »

After installing this version through NPM the loop issue still persists.

How come this isn't an issue in the demo's? Is this covered server wise?
Is there any workaround for now?

Thanks


Post by marcio »

Hey glennvl91,

Yes, the idea is that is covered server-wise. But it can be a bug, but we would like to have a sample project with the behavior that you're describing, as we are not able to replicate that in one of our demos. Could you please provide one?

You can check the guidelines here viewtopic.php?f=1&t=772

Best regards,
Márcio


Post by glennvl91 »

Turns out I needed to add the PhantomId to the response. If this is not returned then the scheduler doesn't know that the event is added.

I didn't see the warning in the console because they were turned off. My bad :-)

thanks though.


Post Reply