-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Parse.Cloud.httprequest fails to delete file with S3 adapter #7232
Comments
I personally don't use the Parse.Cloud.httpRequest. I use S3 so I can try to reproduce this. |
I would be curious to see if anyone could reproduce the issue. |
In the docs, it states that httpRequest is supported for “legacy” reasons. It also hasn’t been updated in 3 years. Should we perhaps depreciate and recommend a dedicated networking option, such as |
I think it would be interesting if anyone could try to reproduce this issue. If that fails, we can just close this. |
Related: #3837 |
New Issue Checklist
Issue Description
Deleting a file in Cloud Code via REST deletes the file from S3 even though it results in a
400 Bad request
response:The http response is
400 Bad request
, but the file is deleted from S3. This has been working before, but it doesn't anymore since some time (weeks, months?), not sure which change caused it to fail, it may even be something in the AWS S3 adapter.Interestingly, it works without issue to delete the same file
Parse.File.destroy()
Because it works with a direct REST request, the issue may well be in
Parse.Cloud.httprequest
, therefore I post this as a Parse Server issue.I have been debugging this down into the AWS S3 SDK, but I wasn't able to fully pin the issue. Looking at the Parse Server S3 adapter's deleteFile:
It seemed as if each AWS S3 client method returns twice, once with a
400
response and once with the actual successful200
callback. In other words, each ofcreateBucket
anddeleteObject
returns twice, but on the first return ofcreateBucket
, thedeleteFile
method returns, passing the400
response to the originalParse.Cloud.httpRequest
.The Parse Server S3 adapter does not have Parse Server integration tests, and Parse Server does not test with the adapter, so I wasn't sure how to write a failing test case. Would be great if someone could try to reproduce this.
@dplewis You added the
Parse.File.destroy
method to the Parse JS SDK recently, maybe you came across something like this?Steps to reproduce
Parse.Cloud.httpRequest
as shown above.Actual Outcome
Parse.Cloud.httpRequest
should return correct response.Expected Outcome
Parse.Cloud.httpRequest
returns incorrect response, 400 instead of 200, even though the file is deleted from S3.Failing Test Case / Pull Request
Environment
Server
commit 2b9b336dd9d388ddb1b4099b87ff6a0d679199d7
-
local and remote
Database
irrelevant
irrelevant
irrelevant
Client
Parse JS SDK in Cloud Code
3.1
Logs
(none)
The text was updated successfully, but these errors were encountered: