Permissions UI

This is a bit tricky. You are introducing a race condition here. Using possibly old document to determine the state. Couldn't you use the information about succeeded or not queries to determine what was and what is?