[Question] state when update lifecycle failed

Hi all, i noticed that when update lifecycle fail (via returning error in UpdateContext), the state was actually updated and on the subsequent apply, (*schema.ResourceData).HasChange() will return false.

To keep the old state, i need to manually invoke (*schema.ResourceData).Set() with old state that can be obtained from (*schema.ResourceData).GetChange() when update fail.

is this expected?