When the hashing is in progress, we tell the server that our store hashes are correct. We were concluding that the hashing is in progress by checking if a hash value is null - which was incorrect because it can be null when an entry is missing. The solution was to introduce a function that tells if we can perform a state sync. This function returns false when thread store hashing is in progress and when we perform user state sync with non-authoritative keyservers.
https://linear.app/comm/issue/ENG-7990/state-sync-sometimes-doesnt-fix-the-state