title: Firestore DocumentSnapshot exists issue with Security Rules
body: <p>So, what's the point of having <code>.exists()</code>, if the promise always fails because the document is not found ( it doesn't actually exist yet ).</p>
  
  <pre><code>match /conversations/{conversationId} {
      allow read: if request.auth.uid in resource.data.participants
  }
  </code></pre>
  
  <p>This would be the query ( minimalistic example )</p>
  
  <pre><code>store.conversations
      .doc( conversationId )
      .get()
      .then( async snapshot =&gt; {
          if ( !snapshot.exists )
              data = await dispatch( startConversation( participant ) )
      }
      .catch( console.err )
  </code></pre>
  
  <p>That dispatch would never trigger if the document does not exist, because the security rules expect <code>request.auth.uid</code> to be in the <code>resource.data.participants</code> array, which sometimes, is not the case.</p>
  
  <p>The only way I can think of fixing this is to change the security rules to allow reading when the document does not exist. But that simply feels counter-intuitive.</p>
  
  <pre><code>match /conversations/{conversationId} {
  
      function conversationExists(conversationId) {
          return exists(/databases/$(database)/documents/conversations/$(conversationId))
      }
  
      allow read: if request.auth.uid in resource.data.participants || !conversationExists(conversationId)
  
  }
  </code></pre>
  
  <p>I would treat the issue within <code>.catch()</code> but, I can't know if it's a document missing issue or some other thing which caused it ( timeout, network issues, whatever ).</p>
  
  <p>Any clue as to what is considered best practice in this case?</p>