Skip to content

Adds repro for issue #4762 #4764

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

Closed
wants to merge 3 commits into from
Closed

Conversation

flovilmart
Copy link
Contributor

@flovilmart flovilmart commented May 14, 2018

Logs:

verbose: REQUEST for [POST] /1/batch: {
  "requests": [
    {
      "method": "POST",
      "body": {
        "key": 1
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 2
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 3
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 4
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 5
      },
      "path": "/1/classes/Object"
    }
  ]
} method=POST, url=/1/batch, user-agent=node-XMLHttpRequest, Parse/js1.11.1 (NodeJS 8.10.0), accept=*/*, content-type=text/plain, host=localhost:8378, content-length=457, connection=close, requests=[method=POST, key=1, path=/1/classes/Object, method=POST, key=2, path=/1/classes/Object, method=POST, key=3, path=/1/classes/Object, method=POST,key=4, path=/1/classes/Object, method=POST, key=5, path=/1/classes/Object]
verbose: RESPONSE from [POST] /1/batch: {
  "response": [
    {
      "success": {
        "objectId": "1OtAIeUHLR",
        "createdAt": "2018-05-14T18:30:14.012Z"
      }
    },
    {
      "success": {
        "objectId": "z16G0O6abX",
        "createdAt": "2018-05-14T18:30:14.012Z"
      }
    },
    {
      "success": {
        "objectId": "spsHOyOE5w",
        "createdAt": "2018-05-14T18:30:14.012Z"
      }
    },
    {
      "success": {
        "objectId": "dEEDWtOkJk",
        "createdAt": "2018-05-14T18:30:14.012Z"
      }
    },
    {
      "success": {
        "objectId": "EC5XIebDB2",
        "createdAt": "2018-05-14T18:30:14.012Z"
      }
    }
  ]
} response=[objectId=1OtAIeUHLR, createdAt=2018-05-14T18:30:14.012Z, objectId=z16G0O6abX, createdAt=2018-05-14T18:30:14.012Z, objectId=spsHOyOE5w, createdAt=2018-05-14T18:30:14.012Z, objectId=dEEDWtOkJk, createdAt=2018-05-14T18:30:14.012Z, objectId=EC5XIebDB2, createdAt=2018-05-14T18:30:14.012Z]
verbose: REQUEST for [POST] /1/batch: {
  "requests": [
    {
      "method": "POST",
      "body": {
        "objects": [
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "1OtAIeUHLR"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "z16G0O6abX"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "spsHOyOE5w"
          }
        ]
      },
      "path": "/1/classes/Parent"
    },
    {
      "method": "POST",
      "body": {
        "objects": [
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "z16G0O6abX"
          }
        ]
      },
      "path": "/1/classes/Parent"
    },
    {
      "method": "POST",
      "body": {
        "objects": []
      },
      "path": "/1/classes/Parent"
    }
  ]
} method=POST, url=/1/batch, user-agent=node-XMLHttpRequest, Parse/js1.11.1 (NodeJS 8.10.0), accept=*/*, content-type=text/plain, host=localhost:8378, content-length=610, connection=close, requests=[method=POST, objects=[__type=Pointer, className=Object, objectId=1OtAIeUHLR, __type=Pointer, className=Object, objectId=z16G0O6abX, __type=Pointer, className=Object, objectId=spsHOyOE5w], path=/1/classes/Parent, method=POST, objects=[__type=Pointer, className=Object, objectId=z16G0O6abX], path=/1/classes/Parent, method=POST, objects=[], path=/1/classes/Parent]
verbose: RESPONSE from [POST] /1/batch: {
  "response": [
    {
      "success": {
        "objectId": "azbzJDOlYE",
        "createdAt": "2018-05-14T18:30:14.076Z"
      }
    },
    {
      "success": {
        "objectId": "VrOuIeTfED",
        "createdAt": "2018-05-14T18:30:14.076Z"
      }
    },
    {
      "success": {
        "objectId": "BIEVwKoBj4",
        "createdAt": "2018-05-14T18:30:14.076Z"
      }
    }
  ]
} response=[objectId=azbzJDOlYE, createdAt=2018-05-14T18:30:14.076Z, objectId=VrOuIeTfED, createdAt=2018-05-14T18:30:14.076Z, objectId=BIEVwKoBj4, createdAt=2018-05-14T18:30:14.076Z]
verbose: REQUEST for [GET] /1/classes/Parent: {
  "where": {
    "objects": {
      "$all": [
        {
          "__type": "Pointer",
          "className": "Object",
          "objectId": "1OtAIeUHLR"
        },
        {
          "__type": "Pointer",
          "className": "Object",
          "objectId": "z16G0O6abX"
        }
      ]
    }
  }
} method=GET, url=/1/classes/Parent, user-agent=node-XMLHttpRequest, Parse/js1.11.1 (NodeJS 8.10.0), accept=*/*, content-type=text/plain, host=localhost:8378, content-length=313, connection=close, $all=[__type=Pointer, className=Object, objectId=1OtAIeUHLR, __type=Pointer, className=Object, objectId=z16G0O6abX]
verbose: RESPONSE from [GET] /1/classes/Parent: {
  "response": {
    "results": [
      {
        "objectId": "azbzJDOlYE",
        "objects": [
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "1OtAIeUHLR"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "z16G0O6abX"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "spsHOyOE5w"
          }
        ],
        "createdAt": "2018-05-14T18:30:14.076Z",
        "updatedAt": "2018-05-14T18:30:14.076Z"
      }
    ]
  }
} results=[objectId=azbzJDOlYE, objects=[__type=Pointer, className=Object, objectId=1OtAIeUHLR, __type=Pointer, className=Object, objectId=z16G0O6abX, __type=Pointer, className=Object, objectId=spsHOyOE5w], createdAt=2018-05-14T18:30:14.076Z, updatedAt=2018-05-14T18:30:14.076Z]

@codecov
Copy link

codecov bot commented May 14, 2018

Codecov Report

Merging #4764 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4764      +/-   ##
==========================================
+ Coverage   92.66%   92.69%   +0.03%     
==========================================
  Files         119      119              
  Lines        8585     8585              
==========================================
+ Hits         7955     7958       +3     
+ Misses        630      627       -3
Impacted Files Coverage Δ
src/RestWrite.js 93.6% <0%> (+0.18%) ⬆️
src/Adapters/Cache/InMemoryCache.js 100% <0%> (+8.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c357df...3d0847b. Read the comment docs.

@flovilmart
Copy link
Contributor Author

Second spec logs:

verbose: REQUEST for [POST] /1/batch: {
  "requests": [
    {
      "method": "POST",
      "body": {
        "key": 1
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 2
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 3
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 4
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 5
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 6
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 7
      },
      "path": "/1/classes/Object"
    },
    {
      "method": "POST",
      "body": {
        "key": 8
      },
      "path": "/1/classes/Object"
    }
  ]
} method=POST, url=/1/batch, user-agent=node-XMLHttpRequest, Parse/js1.11.1 (NodeJS 8.10.0), accept=*/*, content-type=text/plain, host=localhost:8378, content-length=643, connection=close, requests=[method=POST, key=1, path=/1/classes/Object, method=POST, key=2, path=/1/classes/Object, method=POST, key=3, path=/1/classes/Object, method=POST,key=4, path=/1/classes/Object, method=POST, key=5, path=/1/classes/Object, method=POST, key=6, path=/1/classes/Object, method=POST, key=7, path=/1/classes/Object, method=POST, key=8, path=/1/classes/Object]
verbose: RESPONSE from [POST] /1/batch: {
  "response": [
    {
      "success": {
        "objectId": "5W1i5CeEFf",
        "createdAt": "2018-05-14T18:56:13.709Z"
      }
    },
    {
      "success": {
        "objectId": "CEtneaOrRm",
        "createdAt": "2018-05-14T18:56:13.710Z"
      }
    },
    {
      "success": {
        "objectId": "gQkCYVZ0ET",
        "createdAt": "2018-05-14T18:56:13.710Z"
      }
    },
    {
      "success": {
        "objectId": "hFPeNLQ1Di",
        "createdAt": "2018-05-14T18:56:13.710Z"
      }
    },
    {
      "success": {
        "objectId": "01oekkZXd6",
        "createdAt": "2018-05-14T18:56:13.710Z"
      }
    },
    {
      "success": {
        "objectId": "CytECD5vHA",
        "createdAt": "2018-05-14T18:56:13.710Z"
      }
    },
    {
      "success": {
        "objectId": "T5TstAS8EZ",
        "createdAt": "2018-05-14T18:56:13.710Z"
      }
    },
    {
      "success": {
        "objectId": "hRAMI8lYgY",
        "createdAt": "2018-05-14T18:56:13.710Z"
      }
    }
  ]
} response=[objectId=5W1i5CeEFf, createdAt=2018-05-14T18:56:13.709Z, objectId=CEtneaOrRm, createdAt=2018-05-14T18:56:13.710Z, objectId=gQkCYVZ0ET, createdAt=2018-05-14T18:56:13.710Z, objectId=hFPeNLQ1Di, createdAt=2018-05-14T18:56:13.710Z, objectId=01oekkZXd6, createdAt=2018-05-14T18:56:13.710Z, objectId=CytECD5vHA, createdAt=2018-05-14T18:56:13.710Z, objectId=T5TstAS8EZ, createdAt=2018-05-14T18:56:13.710Z, objectId=hRAMI8lYgY, createdAt=2018-05-14T18:56:13.710Z]
verbose: REQUEST for [POST] /1/batch: {
  "requests": [
    {
      "method": "POST",
      "body": {
        "objects": [
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "5W1i5CeEFf"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "CEtneaOrRm"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "gQkCYVZ0ET"
          }
        ]
      },
      "path": "/1/classes/Parent"
    },
    {
      "method": "POST",
      "body": {
        "objects": [
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "CEtneaOrRm"
          }
        ]
      },
      "path": "/1/classes/Parent"
    },
    {
      "method": "POST",
      "body": {
        "objects": [
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "CEtneaOrRm"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "gQkCYVZ0ET"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "hFPeNLQ1Di"
          }
        ]
      },
      "path": "/1/classes/Parent"
    }
  ]
} method=POST, url=/1/batch, user-agent=node-XMLHttpRequest, Parse/js1.11.1 (NodeJS 8.10.0), accept=*/*, content-type=text/plain, host=localhost:8378, content-length=807, connection=close, requests=[method=POST, objects=[__type=Pointer, className=Object, objectId=5W1i5CeEFf, __type=Pointer, className=Object, objectId=CEtneaOrRm, __type=Pointer, className=Object, objectId=gQkCYVZ0ET], path=/1/classes/Parent, method=POST, objects=[__type=Pointer, className=Object, objectId=CEtneaOrRm], path=/1/classes/Parent, method=POST, objects=[__type=Pointer, className=Object, objectId=CEtneaOrRm, __type=Pointer, className=Object, objectId=gQkCYVZ0ET, __type=Pointer, className=Object, objectId=hFPeNLQ1Di], path=/1/classes/Parent]
verbose: RESPONSE from [POST] /1/batch: {
  "response": [
    {
      "success": {
        "objectId": "8GrQ6N2Nsx",
        "createdAt": "2018-05-14T18:56:13.781Z"
      }
    },
    {
      "success": {
        "objectId": "iEYi4sbyz8",
        "createdAt": "2018-05-14T18:56:13.781Z"
      }
    },
    {
      "success": {
        "objectId": "yK2GZpho5h",
        "createdAt": "2018-05-14T18:56:13.781Z"
      }
    }
  ]
} response=[objectId=8GrQ6N2Nsx, createdAt=2018-05-14T18:56:13.781Z, objectId=iEYi4sbyz8, createdAt=2018-05-14T18:56:13.781Z, objectId=yK2GZpho5h, createdAt=2018-05-14T18:56:13.781Z]
verbose: REQUEST for [GET] /1/classes/Parent: {
  "where": {
    "objects": {
      "$all": [
        {
          "__type": "Pointer",
          "className": "Object",
          "objectId": "CEtneaOrRm"
        },
        {
          "__type": "Pointer",
          "className": "Object",
          "objectId": "gQkCYVZ0ET"
        }
      ]
    }
  }
} method=GET, url=/1/classes/Parent, user-agent=node-XMLHttpRequest, Parse/js1.11.1 (NodeJS 8.10.0), accept=*/*, content-type=text/plain, host=localhost:8378, content-length=313, connection=close, $all=[__type=Pointer, className=Object, objectId=CEtneaOrRm, __type=Pointer, className=Object, objectId=gQkCYVZ0ET]
verbose: RESPONSE from [GET] /1/classes/Parent: {
  "response": {
    "results": [
      {
        "objectId": "8GrQ6N2Nsx",
        "objects": [
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "5W1i5CeEFf"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "CEtneaOrRm"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "gQkCYVZ0ET"
          }
        ],
        "createdAt": "2018-05-14T18:56:13.781Z",
        "updatedAt": "2018-05-14T18:56:13.781Z"
      },
      {
        "objectId": "yK2GZpho5h",
        "objects": [
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "CEtneaOrRm"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "gQkCYVZ0ET"
          },
          {
            "__type": "Pointer",
            "className": "Object",
            "objectId": "hFPeNLQ1Di"
          }
        ],
        "createdAt": "2018-05-14T18:56:13.781Z",
        "updatedAt": "2018-05-14T18:56:13.781Z"
      }
    ]
  }
} results=[objectId=8GrQ6N2Nsx, objects=[__type=Pointer, className=Object, objectId=5W1i5CeEFf, __type=Pointer, className=Object, objectId=CEtneaOrRm, __type=Pointer, className=Object, objectId=gQkCYVZ0ET], createdAt=2018-05-14T18:56:13.781Z, updatedAt=2018-05-14T18:56:13.781Z, objectId=yK2GZpho5h, objects=[__type=Pointer, className=Object, objectId=CEtneaOrRm, __type=Pointer, className=Object, objectId=gQkCYVZ0ET, __type=Pointer, className=Object, objectId=hFPeNLQ1Di], createdAt=2018-05-14T18:56:13.781Z, updatedAt=2018-05-14T18:56:13.781Z]

@jeremypiednoel
Copy link
Contributor

Thanks @flovilmart

here is the case to reproduce

const objects = [1,2,3,4,5,6,7,8].map((idx) => {
  const obj = new Parse.Object('Object');
  obj.set('key', idx);
  return obj;
});
let parent;
let parent3;

Parse.Object.saveAll(objects).then(() => {
  parent = new Parse.Object('Parent');
  parent.set('objects', objects.slice(0, 3));
  
  const parent2 = new Parse.Object('Parent');
  parent2.set('objects', [objects[1]]);
  
  parent3 = new Parse.Object('Parent');
  parent3.set('objects', objects.slice(1, 4));
  
  return Parse.Object.saveAll([parent, parent2, parent3]);
}).then(() => {
  const query = new Parse.Query('Parent');
  query.containedIn('objects', objects);
  return query.find();
}).then((result) => {
  expect(result[0].id).not.toBeUndefined();
  expect(result[1].id).not.toBeUndefined();
  expect(result[2].id).not.toBeUndefined();
  expect(result.length).toBe(3);
}).then(done).catch(done.fail);

@flovilmart flovilmart closed this May 18, 2018
@flovilmart flovilmart deleted the issue/4762-containedIn-pointers branch August 7, 2018 15:34
@flovilmart flovilmart restored the issue/4762-containedIn-pointers branch August 7, 2018 15:35
@flovilmart flovilmart deleted the issue/4762-containedIn-pointers branch August 7, 2018 15:42
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

Successfully merging this pull request may close these issues.

2 participants