-
-
Notifications
You must be signed in to change notification settings - Fork 735
Description
My setup
- parse-server 2.6.3
- Parse-SDK-Android 1.17.3
Server code
Parse.Cloud.beforeDelete("TestClass", function(request, response) {
response.error("Delete is not allowed");
});
Android JUnit4 test code
@test
public void testDeleteObject() throws Exception {
ParseObject object = ParseObject.create("TestClass");
object.save();
object.delete();
}
Expectation
The Android test should fail as object.delete() should throw a ParseException.
Result
The Android test passes (no exception).
Server logs
verbose: REQUEST for [POST] /parse/classes/TestClass: {} method=POST, url=/parse/classes/TestClass, x-parse-session-token=r:xxx, x-parse-application-id=xxx, x-parse-client-version=a1.17.3, x-parse-app-build-version=2116, x-parse-app-display-version=2.1.1.0, x-parse-os-version=P, user-agent=Parse Android SDK 1.17.3 (com.perfexpert/2116) API Level 27, x-parse-installation-id=39b74a67-f47f-4ce5-b6fc-d2b881312cbe, x-parse-client-key=xxx, content-type=application/json, content-length=2, host=10.0.2.2:1337, connection=Keep-Alive, accept-encoding=gzip,
verbose: RESPONSE from [POST] /parse/classes/TestClass: {
"status": 201,
"response": {
"objectId": "V959ykRkPx",
"createdAt": "2018-05-16T16:12:20.408Z"
},
"location": "http://localhost:1337/parse/classes/TestClass/V959ykRkPx"
} status=201, objectId=V959ykRkPx, createdAt=2018-05-16T16:12:20.408Z, location=http://localhost:1337/parse/classes/TestClass/V959ykRkPx
verbose: REQUEST for [DELETE] /parse/classes/TestClass/V959ykRkPx: {} method=DELETE, url=/parse/classes/TestClass/V959ykRkPx, x-parse-session-token=r:xxx, x-parse-application-id=xxx, x-parse-client-version=a1.17.3, x-parse-app-build-version=2116, x-parse-app-display-version=2.1.1.0, x-parse-os-version=P, user-agent=Parse Android SDK 1.17.3 (com.perfexpert/2116) API Level 27, x-parse-installation-id=39b74a67-f47f-4ce5-b6fc-d2b881312cbe, x-parse-client-key=xxx, host=10.0.2.2:1337, connection=Keep-Alive, accept-encoding=gzip,
error: beforeDelete failed for TestClass for user QgYc16oZWm:
Input: {"createdAt":"2018-05-16T16:12:20.408Z","updatedAt":"2018-05-16T16:12:20.408Z","objectId":"V959ykRkPx"}
Error: {"code":141,"message":"Delete is not allowed"} className=TestClass, triggerType=beforeDelete, code=141, message=Delete is not allowed, user=QgYc16oZWm
error: Error generating response. ParseError { code: 141, message: 'Delete is not allowed' } code=141, message=Delete is not allowed
error: Delete is not allowed code=141, message=Delete is not allowed