Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Relations are not sent. #1152

Closed
3 tasks done
lolobosse opened this issue Mar 23, 2016 · 1 comment
Closed
3 tasks done

Empty Relations are not sent. #1152

lolobosse opened this issue Mar 23, 2016 · 1 comment

Comments

@lolobosse
Copy link

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

VERBOSE=1

Steps to reproduce

Same as the issue #1136, it is really hard to reproduce but I put every detail in the logs

Logs/Trace

So, the problem is pretty simple, there is a difference between the parse.com response and the parse-server response. I do not know if it is by design but what I know is that it makes my app crash 😆

The idea is that parse-server does not send the existence of the relation in the object (even if they are in schema):

Parse-Server

{
    "objectId": "8RZCH4EdCL",
    "location": {
        "__type": "GeoPoint",
        "latitude": 48.137004,
        "longitude": 11.575928
    },
    "criteria": [{
        "key": "Deutsch - fließend",
        "status": true
    }, {
        "key": "Führerschein-Klasse B",
        "status": true
    }],
    "merchant": {
        "ACL": {
            "km36mV2uG2": {
                "read": true,
                "write": true
            },
            "*": {
                "read": true
            }
        },
        "objectId": "km36mV2uG2",
        "address": {
            "__type": "GeoPoint",
            "latitude": 51.6102001,
            "longitude": 0.5754663000000164
        },
        "username": "[email protected]",
        "email": "[email protected]",
        "merchant": true,
        "salutation": "test",
        "firstName": "test",
        "lastName": "test",
        "name": "test test test",
        "addressString": "Rawreth, Wickford, Essex SS11, UK",
        "company": "test",
        "phone": "11",
        "emailOpen": true,
        "phoneOpen": false,
        "updatedAt": "2016-03-21T19:23:23.732Z",
        "createdAt": "2016-03-21T19:21:41.325Z",
        "emailVerified": true,
        "__type": "Object",
        "className": "_User"
    },
    "title": "test",
    "salaryAmount": 1111,
    "description": "test",
    "finished": false,
    "category": {
        "__type": "Pointer",
        "className": "Category",
        "objectId": "MnaaKc2Rn1"
    },
    "salaryGiven": true,
    "salaryTimeUnit": "pro Monat",
    "updatedAt": "2016-03-21T19:25:27.661Z",
    "createdAt": "2016-03-21T19:25:27.661Z"
}

Likes, Matches and Dislikes are missing. However they're in Parse.com

{
    "createdAt": "2016-02-27T17:43:06.241Z",
    "criteria": [{
        "key": "Deutsch - fließend",
        "status": true
    }, {
        "key": "Mindestens 18 Jahre alt",
        "status": true
    }],
    "description": "I love the tests",
    "dislikes": {
        "__type": "Relation",
        "className": "_User"
    },
    "likes": {
        "__type": "Relation",
        "className": "_User"
    },
    "location": {
        "__type": "GeoPoint",
        "latitude": 48.137004,
        "longitude": 11.575928
    },
    "matches": {
        "__type": "Relation",
        "className": "_User"
    },
    "merchant": {
        "Criteria": [],
        "__type": "Object",
        "className": "_User",
        "createdAt": "2016-02-27T17:14:40.294Z",
        "email": "[email protected]",
        "emailVerified": true,
        "firstName": "Laurent",
        "lastName": "Meyer",
        "objectId": "ver8RkWZIQ",
        "test": {
            "__type": "Relation",
            "className": "_User"
        },
        "updatedAt": "2016-02-27T19:12:04.381Z",
        "username": "lolobosseMerchant"
    },
    "objectId": "3ZWdQStMRy",
    "selected": {
        "__type": "Pointer",
        "className": "_User",
        "objectId": "XiVpb2r6LJ"
    },
    "title": "I test the QA2",
    "updatedAt": "2016-03-22T18:41:42.447Z"
}

For the sceptical here is my schema from Parse server:

{
   "className":"Job",
   "fields":{
      "title":{
         "type":"String"
      },
      "merchant":{
         "type":"Pointer",
         "targetClass":"_User"
      },
      "matches":{
         "type":"Relation",
         "targetClass":"_User"
      },
      "likes":{
         "type":"Relation",
         "targetClass":"_User"
      },
      "description":{
         "type":"String"
      },
      "finished":{
         "type":"Boolean"
      },
      "salaryTimeUnit":{
         "type":"String"
      },
      "salaryAmount":{
         "type":"Number"
      },
      "location":{
         "type":"GeoPoint"
      },
      "dislikes":{
         "type":"Relation",
         "targetClass":"_User"
      },
      "reviewed":{
         "type":"Boolean"
      },
      "selected":{
         "type":"Pointer",
         "targetClass":"_User"
      },
      "reviewed_by_user":{
         "type":"Boolean"
      },
      "category":{
         "type":"Pointer",
         "targetClass":"Category"
      },
      "criteria":{
         "type":"Array"
      },
      "salaryGiven":{
         "type":"Boolean"
      },
      "fromDetailView":{
         "type":"Boolean"
      },
      "createdBy":{
         "type":"Pointer",
         "targetClass":"_User"
      },
      "ACL":{
         "type":"ACL"
      },
      "createdAt":{
         "type":"Date"
      },
      "updatedAt":{
         "type":"Date"
      },
      "objectId":{
         "type":"String"
      }
   },
   "classLevelPermissions":{
      "find":{
         "*":true
      },
      "get":{
         "*":true
      },
      "create":{
         "*":true
      },
      "update":{
         "*":true
      },
      "delete":{
         "*":true
      },
      "addField":{
         "*":true
      },
      "readUserFields":[

      ],
      "writeUserFields":[

      ]
   }
}

Did I miss something or it is actually a bug?

@flovilmart
Copy link
Contributor

duplicate from #1311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants