Our pure JavaScript Scheduler component


Post by geethananth m u »

Hi,

In my application, I have an option where the user clicks on a menu option, which triggers a backend API call. The response contains a new resource and an event. When I use apply changeset to add the new resource and event, it triggers a sync call. It only happens when I try to add a new event via applychangeset. What can I do to cancel this sync trigger?

I have set autosync to true in my crudmanager config.


Post by tasnim »


Post by geethananth m u »

When I resume auto-sync, the sync call is triggered. How can I stop it altogether? I mean, I don't want the sync call to get invoked in this case since the data is already available in the back-end.


Post by johan.isaksson »

Hi,

Calling resumeAutoSync(false) should not directly trigger a sync. But the changes will still be there and get synced next time. To clear changes, call crudManager.acceptChanges().

With that said, the fact that changes from applyChangeset() ends up leading to a sync does not sound like ideal behavior. I will open a ticket on investigating that, probably it should not flag the stores as modified.

Ticket for that here: https://github.com/bryntum/support/issues/7889

Hopefully you will be able to work around it though, based on the above!

Best regards,
Johan Isaksson

Post by Maxim Gorkovsky »

Hello geethananth m u,
Could you please clarify what are those changes and why don't you want to persist them. For example, when you provide a record with only a start and end date, duration will be calculated and duration is persisted field by default. So project will calculate it and send in a new sync response. You can set duration to be not persistable, in which case duration will always be ignored and will not be sent from the client.

Therefore, I would like to know what the response and new change were.


Post by ghulam.ghous »

The fix introduced in https://github.com/bryntum/support/issues/7889 is reverted in https://github.com/bryntum/support/issues/8263 because it was kind of a invalid use case. As Maxim mentioned duration is a persisted field and if backend for some reason returns your record without duration, local project calculates the duration as it is a persisted field. And if the duration is not returned intentionally in the response, then to avoid these changes, you need to mark the duration as non persistable at the application level. In either way your problem is going to be fixed without this fix.


Post Reply