VersionedState
ref / conversations / VersionedState
A value with a version.
The version consists of two pieces.
The first piece is a number that is defined by the plugin internally and cannot be changed. When the plugin is updated and it changes its internal data format, then it can use this part of the version to detect and automatically migrate the versioned state as necessary.
The second piece is a number or a string and can be set by the developer. It should be changed whenever the application code changes in a way that invalidates the state. The plugin can then discard and re-create the state as necesarry.
Versioned states are typically created via the pin
Properties
version
ts
version: [typeof PLUGIN_DATA_VERSION, string | number];
The version of the state
state
ts
state: S;
The state to be versioned