Our powerful JS Calendar component


Post by joversdev »

Hi,

I've been experiencing a strange bug after the 4.1.4 update regarding the autoSync with the crudManager. After sending one sync request and successfully receiving a response, the calendar will send another request with the same data and I begin to get duplicates of data. This happens every double click.

I know that something this complex would require a testable demo of some sort, but being that it requires a workable backend to simulate a response from a server, I'm not sure how best to supply that. I tried to replicate this on the php backend example by using the "onBeforeSync" handler, but I couldn't replicate it there. However, I get two hits on that handler when working with react + AspNetCore.

I will say that after the first sync, the old bug where the event would sync after doubleclick reappears regardless of me closing without saving.

I can attempt to constuct a test case, I'm just not sure how much time I would need. I would think a simple project loaded in react using the autoSync would be able to demonstrate this bug. If it doesn't then I'm unsure as to what I've done to my configs that would result in such a farce.

Alternatively, could it be the calendar re-submits data if the returned data from the server isn't of the right format?

Thank you.

Edit: As a note, the bug from <4.1.4, I definitely can still double click and then click cancel, and get a message logged to console from the onBeforeSync handler and a hit on my server. I have verified I'm using version 4.1.4 via npm.


Post by mats »

Can you please post your server response so we can see if it's a valid response.

Edit: As a note, the bug from <4.1.4, I definitely can still double click and then click cancel, and get a message logged to console from the onBeforeSync handler and a hit on my server. I have verified I'm using version 4.1.4 via npm.

Sounds like a bug too, we'll check. https://github.com/bryntum/support/issues/2972


Post by joversdev »

This is generally the response data:

{"revision":0,"events":{"rows":[{"$PhantomId":"_generatedClassDefEx4","id":"60b8c6034e930a649479af87"}],"removed":[]},"success":true,"requestId":16227220519477}

It's based on the SyncResponse and SyncStoreResponse classes from the AspNetCore demos. I however, managed to fix my error with duplicate events being created, I had the SyncStoreResponse attached on the sync response, making the "rows" property appear top level instead of rows being under the store name, in this case, "events".

So my bad response looked like this

{"revision":0,"rows":{"$PhantomId":"_generatedClassDefEx4","id":"60b8c6034e930a649479af87"},"removed":[]},"success":true,"requestId":16227220519477}

I do still see multiple sync requests hitting, but the calendar is no longer producing multiples of the appointment.


Post by mats »

Ok then it looks simply like issue with wrong format of data. In next release we will add warnings for this scenario (malformed data). We have also fixed the bug where a request was sent on Cancel button press.


Post Reply