Because subscriptions involve recurring revenue and fulfillment, modifications must be handled safely to prevent race conditions or inconsistent states.
Whenever a subscription modification checkout is initiated (e.g., editing the subscription), the framework secures the subscription by acquiring a lock. This lock prevents any other concurrent modifications (like another checkout or a background billing job) from interfering.
Furthermore, modifications are not applied directly to the live subscription data. Instead, they are made within a sandboxed state (a temporary change container). When the fulfillment workflow successfully completes and releases the lock, an event is fired, causing the system to promote these sandboxed changes to the live production state. If the workflow fails, the lock is reverted, and the uncommitted sandbox changes are discarded.