In mobwrite_core.py in the function applyPatches at lines 309 - 313, there is this code:
# First, update the client's shadow.
viewobj.shadow = DMP.diff_text2(diffs)
viewobj.backup_shadow = viewobj.shadow
viewobj.backup_shadow_server_version = viewobj.shadow_server_version
viewobj.changed = True
shouldn't this code instead be:
# First, update the client's shadow.
viewobj.backup_shadow = viewobj.shadow
viewobj.backup_shadow_server_version = viewobj.shadow_server_version
viewobj.shadow = DMP.diff_text2(diffs)
viewobj.changed = True
Otherwise the backup_shadow is always equal to the shadow. My understanding is that the backup shadow should be a backup in case of a duplicate packet or some other rollback scenario.