Stronger scan state mapping
(cherry picked from commit 1e6dd3f9)
The state have changed from enum->int->string. Now the state is a string containing the name of the enum. I expect it to be stable.
(cherry picked from commit 1e6dd3f9)
The state have changed from enum->int->string. Now the state is a string containing the name of the enum. I expect it to be stable.