Major Changes
-
3cbcc3f: Serialized output no longer uses field names that start with
$or_. Stores such as Convex reject both prefixes, and MongoDB restricts$-prefixed field names, so persisted snapshots,systemTransitionsnapshots and effect descriptors could not be stored without rewriting them.Before After Where { $actor: address, incarnation }{ '@actor': address, incarnation }SerializedActorRef: persisted context,systemTransitionsnapshots, effect descriptors,sendTotargets, dead letters,@xstate/effectactortoJSON()_nextTimerIdnextTimerIdPersisted snapshots, systemTransitionsnapshots_nextActorIdsnextActorIdsPersisted snapshots, systemTransitionsnapshots_stateInputsstateInputssystemTransitionsnapshots (persisted snapshots already usedstateInputs){ $error: name, message }{ '@error': name, message }systemTransitionsnapshots,@xstate/testtraces{ $stateNode: id },{ $systemMapper: key }{ '@stateNode': id },{ '@systemMapper': key }systemTransitionsnapshots// Before { $actor: 'order/worker', incarnation: 'a:1' } // After { '@actor': 'order/worker', incarnation: 'a:1' }
snapshot.toJSON()no longer includes the private_nextTimerIdand_nextActorIdscounters.Snapshots written by
6.0.0-beta.1with the old field names still restore:restoreActor,restoreMachineSnapshotandsystemTransitionread both shapes. New snapshots use only the new names. Schemas that validate persisted snapshots (for example withmachineVersions) must use the new names.