Transactions: atomicity and labeling?

Welcome to the forum @jasonm,

As you assumed transactions are mostly for managing events. We don’t want to fire a single event for each character that is inserted. Instead, we can bundle many changes into a single transaction, so the event only fires once, and we only need to update the (presumably) DOM once after all changes have been performed.

In most cases, you can assume that transactions ensure that a change is applied as an atomic operation. However, there are some edge cases when this is not true. These edge cases always involve at least three clients. If one of the changes performed depends on a change that has not been applied yet to the local copy, we will only apply the changes that can be applied and apply the other changes once the dependencies have been applied.

In theory, it would be possible to do what you are asking. However, this hasn’t been an issue yet and we are focusing on other things at the moment.

If you want to replay the operations (e.g. for debugging purposes), I suggest that you log the generated update messages somewhere instead of the transactions (including the origin field and the transaction.local field if you like). You can, of course also store Transactions. However, they contain a lot of information that we usually would like to discard (e.g. objects intended for garbage-collection and potentially a lot of object references).