-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
fix: File upload fails when uploading base64 data #1578
fix: File upload fails when uploading base64 data #1578
Conversation
Thanks for opening this pull request!
|
I will reformat the title to use the proper commit message syntax. |
Hi @mtrezza! All the test cases are now passing. File uploading works now. The overriding of Parse SDK using the git repo git@github.com:musthafa1996/Parse-SDK-JS.git#file-upload-issue for Parse server was necessary to make sure Parse Server uses the Parse SDK with the file upload fix. Once approved we’ll need to do the following:
|
Great, could you solve the conflict so we can see whether the CI passes? I think the next step then would be to revert the changes in package and package-lock and commit the fix, right? |
I've resolved the conflicts @mtrezza. |
@mtrezza, did you just run the CI. Looks like the old SSH repo URL (git@github.com:musthafa1996/Parse-SDK-JS.git#file-upload-issue) was being used instead of HTTPS repo URL (git+https://github.com/musthafa1996/Parse-SDK-JS.git#file-upload-issue). Is there a way we can ensue the latter is used? |
Is the change necessary for this PR? If not, let's keep it as is and revert any changes made in package and package-lock. |
This change is necessary. Otherwise you'll keep getting Permission denied error while accessing the git repo. |
Can you try reverting the package and package-lock please |
Also, I noticed that there is no test in the JS SDK for this change. Is it possible to add a test that fails without the change? |
You mean reverting the overrides for Parse SDK too? |
Yes, the only file that this PR should change is |
The failing test case wouldn't be possible unless you force Parse server to use the latest alpha version of the Parse SDK. The issue was induce in the recent updates to Parse SDK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this was not a lint change, we should also keep this line as is
Codecov ReportBase: 99.93% // Head: 99.93% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## alpha #1578 +/- ##
=======================================
Coverage 99.93% 99.93%
=======================================
Files 61 61
Lines 5963 5966 +3
Branches 1364 1366 +2
=======================================
+ Hits 5959 5962 +3
Misses 4 4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Great, so if you now removed the fix, the tests would fail, even without the override of Parse Server, correct? |
Yes, that’s right. |
@dplewis Not sure about the override suggestion maybe that would just complicate things? I think the sustainable solution is to move all into a monorepo. We are planning to do that in 2023. For this PR, all looks good now. |
Anything pending here? |
@musthafa1996 I added a few more tests. @mtrezza I think this is ready for review |
Rerunning the CI multiple times would get the integration test to succeed. |
@musthafa1996 Its a flaky test should be fixed when parse-community/parse-server#8232 gets merged in. Just reran the tests and everything checked out |
Got it. Thanks 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks everyone, looks good!
# [3.5.0-alpha.8](3.5.0-alpha.7...3.5.0-alpha.8) (2022-11-03) ### Bug Fixes * File upload fails when uploading base64 data ([#1578](#1578)) ([03ee3ff](03ee3ff))
🎉 This change has been released in version 3.5.0-alpha.8 |
@musthafa1996 Thank you for looking into this |
I’m glad that i could help fix the issue 😊 |
The issue was kind of tricky to find too due to parse server using an older version of the SDK. I’m really looking forward to mono-repo. Development and bug finding will be much easier. |
🎉 This change has been released in version 3.5.1-beta.1 |
🎉 This change has been released in version 3.5.1-alpha.1 |
## [3.5.1](3.5.0...3.5.1) (2022-11-26) ### Bug Fixes * File upload fails when uploading base64 data ([#1578](#1578)) ([03ee3ff](03ee3ff)) * React Native build does not maintain arrow functions and causes error with AsyncStorage ([#1587](#1587)) ([8aeaa4f](8aeaa4f)) * SDK builds incorrectly since release 3.5.0 causing various bugs ([#1600](#1600)) ([f15154f](f15154f))
🎉 This change has been released in version 3.5.1 |
New Pull Request Checklist
Issue Description
Parse server throws the following error while uploading files:
The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
Related issue: #1579, parse-community/parse-server#8253
Closes #1579, parse-community/parse-server#8253
Approach
Add in the missing assignment of
_data
property with the uploaded file data inParseFile.js
TODOs before merging