Currently mutable state is serialised in the configuration file on termination, this has a couple of issues:
The configuration file blows up, especially when keeping track of things for the seen command
If serialisation fails for some reason, everything is lost as the file gets completely rewritten.
Both issues could be solved by having a small database. Just a key-value store namespaced by plugin would suffice. Furthermore, by separating configuration from state, much of the serialisation stuff can be dropped, and the configuration file can be read-only. If more rich serialisation is required than key-value, the existing Aeson instances for everything can be re-used when reading/writing to the database.
Currently mutable state is serialised in the configuration file on termination, this has a couple of issues:
seen
commandBoth issues could be solved by having a small database. Just a key-value store namespaced by plugin would suffice. Furthermore, by separating configuration from state, much of the serialisation stuff can be dropped, and the configuration file can be read-only. If more rich serialisation is required than key-value, the existing Aeson instances for everything can be re-used when reading/writing to the database.