When a transaction is re-applied from history (redo) it seems it no longer has the original metadata attached.
This can be problematic, for example: My app stores individual blocks in the db. I have a plugin that watches for added/deleted nodes, assigning new IDs and deleting old ones. The app also supports folding. In order to avoid the ID plugin from seeing the fold as a bunch of blocks being deleted, my first thought was to use metadata to indicate the transaction should be ignored by the ID manager.
(btw - I’m aware of the strategy to put folded node json into an attribute, which my ID plugin could also use to behave correctly. That doesn’t work in my context for other reasons. I also don’t want to use addToHistory false, because the user should be able to make edits in a foldable region, fold them up, and still be able to undo them later)
But the metadata solution breaks down when the user undoes or redoes a fold/unfold: the metadata is missing.
This seems like a general problem for many situations where you might use transaction metadata - which makes me think I’m missing something.
Any advice much appreciated!