System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 451.77
Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: rB211b6c29f771
Worked: (newest version of Blender that worked as expected)
Short description of error
OK so I have been trying to crack the code for a while now but I think I figured out the error with my code and it may be an error with the API. I have made a modal operator that allows the user to manually change where the origin is placed, with similar functionality to Mayas pivot editing system. The issue lies with using the use_snap option in toolsettings. It does not seem to register undo states properly in conjunction with a translate bpy.ops. Regardless of the context it always seems to register use_snap as true when you go back into the translate undo state, turning it back on.
My theory is the use_snap option is linked to the translate modal when both are used in conjunction and treats it as one, turning it back on when you redo into the translate state. The ideal scenario is the translate modal be separated from toolsettings.use_snap and saves the undo state properly like every other setting changed (if it needed to be mentioned this is the ONLY toolsetting that reacts this way, and conveniently the only option related to the translate modal).
Here is the pastebin for my code. I ripped it from my scripts so I tried to make it work on its own but if it doesn't it shouldn't be difficult to get it working: https://pastebin.com/d5e0Yzhy
Exact steps for others to reproduce the error
To reproduce the issue using the operator within the paste bin, if you use it on a mesh, undo and then redo back into the operators undo state everything will work as intended except for snapping which turns back on. The intended result is for the snapping to be how it was post-use of the operator. This issue happens if you undo into ANY undo state in which you used the operator, not just if you undo and redo.
Here is a gif to show the issue, after running the operation I simply undo and redo... and there is the issue: https://imgur.com/a/K6kVSE2
I don't have a solution for this problem, so if you somehow do and would be willing to share I would greatly appreciate it.