User status not displayed into the view

Hi! I have a Contacts table that has as a parent the User table. I’m trying to get the status of the user from the user table and display it into the view. Unfortunately when I’m iterating through the contacts list in the view I can only get the id of the parent, not the status of the user(if he is active or not). This is the line of code with the problem:

 <Text weight="bold" size="16px">{i.attributes.parent.get("isActive")}</Text>

Is this not working because I need the master key in order to access the records for the user table or my syntax is wrong? I have also tried to create a cloud function that would get the status of the user using the master key, creating an “isActive” column and updating it in Contacts every time the user logs in or out. For the login it works perfectly, however when I log out, the user still shows as logged in even though the “isActive” column in the User table is updated. This is the cloud function I’m using for this:

  const userQuery = new Moralis.Query("User")
  await userQuery.equalTo("username", request.params.username)
  const res = await userQuery.first({useMasterKey:true})
  return res

and this is the function where I’m using it:

async function getUserSession(){
    const params = {"username":user.get("username")}
    const session = await"getUserSession", params)
    console.log("session", session)
    const query = new Moralis.Query("Contacts")
    query.equalTo("contact", user.get("username"))
    const result = await query.find()
    for(let i=0; i< result.length;i++){
    result[i].set("isActive", session.get('isActive'))

Any help would be appreciated!