Saving and revisions
Every time the state of an entity is saved, VIKTOR stores a revision: a complete snapshot of the entity's input at that moment. Revisions are created automatically while a user works, and can also be created manually to mark a meaningful point in time.
A revision stores the entity's input parameters. Results and views are not stored; they are recomputed when the entity is opened.
Autosave
In simple and tree type apps, changes a user makes in the editor are saved automatically. The user does not have to
press save to keep their work: closing the editor, an interrupted internet connection or an unexpected logout no longer
means losing input.
In editor type apps nothing is saved. Every user gets a fresh editor upon entry and the state is discarded when they
leave. See app types for the differences between the types.
Pausing autosave
A user can pause autosave to try something out without persisting the result: change inputs, look at what the app computes, and leave the entity as they found it. Pausing and resuming are offered in the save menu in the editor toolbar.
A pause holds for the current session on the entity it was paused on. Opening that entity again, or opening another one, starts with autosave active.
While autosave is paused, changes stay in the editor but are not stored. Manual saving remains available and does not end the pause, so a user can store a state they want to keep and continue afterwards.
Leaving the entity while paused discards the changes that were not saved. VIKTOR warns before that happens, so the user can still save or resume autosave first.
Manual saves
A user can save manually at any time, and give that revision a name. Use it to mark a finished set of changes: a named revision is easy to find back later, and it tells colleagues reviewing the entity what that state represents.
A manual save always stores the complete current state, including everything that was already saved automatically before it. It is not limited to the changes made since the last autosave.
Saving manually is always possible, also when nothing has changed since the last save.
Revision history
The history panel lists the revisions of an entity, with the author and the moment they were created. Manually saved revisions are shown by default; automatic saves are grouped and collapsed underneath them, so the history stays readable.
Any revision can be restored. Restoring does not erase anything: the state before restoring remains available as a revision of its own.
Any two revisions can also be compared, by selecting them both in the history panel. Automatic saves can be selected as well, by expanding the group they are collapsed into.
A comparison lists the input parameters that differ, with the section each one belongs to and its value in both revisions. Parameters that are the same in both are left out, so the list is the set of changes between the two states of the entity.
Retention
Manually saved revisions and the current state of an entity are kept indefinitely.
Of the automatic saves, VIKTOR keeps:
- all of them within 15 minutes of the entity's most recent revision, so the latest editing session stays detailed;
- one per 15 minutes before that, for each user that edited the entity.