pawelrojek/nextcloud-drawio

Change Autosave Delay

G33kDude opened this issue · 1 comments

The default autosave delay is very aggressive and results in far too many intermediate versions being generated in the NextCloud versions manager. Is there a way to change the autosave delay?

I've tried setting window.DRAWIO_CONFIG = {"autosaveDelay": 60000} in the PreConfig.js of my locally hosted Diagrams.net instance, but the file still auto-saves as often as before.

Is that delay modifiable at all? Or if there is no configurable delay, is there a rational place to introduce it? I'm more than glad to go in and modify sources, I'm just not familiar enough with the code base to identify what's necessary to change and where.

Thanks!

jensb commented

This is still an issue on Nextcloud 24 with the current draw.io plugin.
Can we have maybe both? The Nextcloud text editor also saves after just about every second keystroke (to enable simultaneous collaborative editing), but still doesn't generate a new version on every autosave.
How do they do this? Maybe draw.io can do the same? Still autosave every change, but create a new version only after substantial changes or a delay, e.g. after 10 object changes or 10 minutes?
Or, alternatively, autosave every change, but only keep manually saved states as versions?