title: Unable to get the Firebase to invoke the observe/observeSingleEvent callback
body: <p>I want to get a user corresponding to an event</p>
  
  <p>I have a list of Events</p>
  
  <pre><code>let eventsRef = FIRDatabase.database().reference.child("Events")
  </code></pre>
  
  <p>I have a list of Users</p>
  
  <pre><code>let usersRef = FIRDatabase.database().reference.child("Users")
  </code></pre>
  
  <p>My Event and User model is as below</p>
  
  <ul>
  <li>Events
  
  <ul>
  <li>Event1
  
  <ul>
  <li>eventHost: user1_uid</li>
  </ul></li>
  <li>Event2 
  
  <ul>
  <li>eventHost: user2_uid</li>
  </ul></li>
  </ul></li>
  <li>Users
  
  <ul>
  <li>User1
  
  <ul>
  <li>email: email1</li>
  </ul></li>
  <li>User2
  
  <ul>
  <li>email: email2</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>The following callback (in the Event model) is never invoked:</p>
  
  <pre><code>if let userKey = eventData["eventHost"] as? String {
    userRef = usersRef.child(userKey)
    userRef.observeSingleEvent(of: .value, with: { snapshot in
      ...           
    })
  }
  </code></pre>
  
  <p>I can confirm that I have not enabled disk persistence and that user uid is available. Is there anything I am doing obviously wrong?</p>
  
  <p>======
  EDIT: The simplified event model</p>
  
  <pre><code>import Foundation
  import Firebase
  
  class Event {
  
      // event metadata
      private var _eventId: String!
      private var _eventHost: User!
  
      var eventId: String {
          return _eventId
      }
  
      var eventHost: User {
          return _eventHost
      }
  
      init(eventId: String, eventData: Dictionary&lt;String, Any&gt;) {
          self._eventId = eventId
  
          if let userKey = eventData["eventHost"] as? String {
              let usersRef = FIRDatabase.database().reference().child("Users")
              let userRef = usersRef.child(userKey)
              print(userRef) 
              userRef.observeSingleEvent(of: .value, with: { (snapshot) in
                  print("USERY: \(snapshot.key)")
                  if let userDict = snapshot.value! as? Dictionary&lt;String, Any&gt; {
                      let id = snapshot.key
                      self._eventHost = User(userId: id, userData: userDict)
                  }
              })
          }
  
      }
  }
  </code></pre>
  
  <p>The <code>print(userRef)</code> resolves to</p>
  
  <pre><code>https://xxxx.firebaseio.com/Users/AFHpS3npOga4tfj10GS2HGeT9uJ3`
  </code></pre>
  
  <p>which is a valid object in my Firebase structure. Snippet of Firebase User structure </p>
  
  <pre><code>  "AFHpS3npOga4tfj10GS2HGeT9uJ3" : {
      "email" : "test@gmail.com",
      "firstName" : "Wilma",
      "lastName" : "Flintstone",
      "profileImageUrl" : "http://images.iimg.in/c/569f4771c45d324bda8b4660-4-501-0-1453279096/google/user-icon-png-pnglogocom.img",
      "provider" : "Firebase",
      "userId" : "AFHpS3npOga4tfj10GS2HGeT9uJ3"
    },
  </code></pre>