commit e4c7447fb91ba4b963e893f10671fd240d0cc12c
parent 546ed7dfb58d09a40df42dd9d18044d40b40c601
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Thu, 18 Apr 2024 18:29:46 +0200
make the delta forward compatible as a requirement
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/clap/ext/draft/undo.h b/include/clap/ext/draft/undo.h
@@ -84,6 +84,12 @@ typedef struct clap_host_undo {
// name: mandatory null terminated string describing the change, this is displayed to the user
// detlas: optional, they are binary blobs used to perform the undo and redo. When not available
// the host will save of the plugin and use state->load() instead.
+ //
+ // Note: the provided delta **must** be serialized in a forward compatible way, because they may be used
+ // for incremental state saving and crash recovery. If the plugin is updated after the host crash,
+ // then we must be able to use delta created with an older version of the plugin.
+ // Worst case plugin->apply_delta() will fail but this is a scenario we prefer to avoid.
+ //
// [main-thread]
void(CLAP_ABI *complete_change)(const clap_host_t *host,
const char *name,