-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
build(deps): bump formidable from 2.1.2 to 3.5.0 in /src #5796
build(deps): bump formidable from 2.1.2 to 3.5.0 in /src #5796
Conversation
@dependabot rebase |
Bumps [formidable](https://github.com/node-formidable/formidable) from 2.1.2 to 3.5.0. - [Release notes](https://github.com/node-formidable/formidable/releases) - [Changelog](https://github.com/node-formidable/formidable/blob/master/CHANGELOG.md) - [Commits](https://github.com/node-formidable/formidable/commits/v3.5.0) --- updated-dependencies: - dependency-name: formidable dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
b6db046
to
3f079e6
Compare
I hackified the
I need to stop now as I have other things to do but hopefully someone can pick it up from here. |
I tried picking up from here but I have no idea why it doesn't update the pad with new text. I didn't find any release notes or upgrade guides. |
@SamTV12345 yeah it's really weird and tbh I got lost too -_- Perhaps @webzwo0i once he's done w/ npm might be suitable to pick it up if he fancies it / has the time / energy. |
I asked the formidable maintainers. Maybe they can help us: node-formidable/formidable#946 . |
6d3e8ea
to
15d4f87
Compare
Force pushed some changes. Looks better now, but probably not 100% ready as it's not clean code... The import error handling might need some more test coverage and I'm pretty sure I did the fields/files parsing wrong/non-idiomatic. However, tests seem to pass now |
The conversion when using multipart/form-data is strange, as it only picks the first element. But it should work across our API. |
in superagent we sometimes use |
const form = new IncomingForm(); | ||
formData = (await form.parse(req))[0]; | ||
for (const k of Object.keys(formData)) { | ||
if (formData[k] instanceof Array) { |
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.
formidable also exports a helper function firstValues
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.
Where should that method be called upon? Line 599? I tried firstValues(await form.parse(req)) but that didn't work.
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.
after you have fields
formData = (await form.parse(req))[0]; //[0] is fields [1] is files
const formDataSingle = firstValues(form, formData);
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.
and then use formDataSingle variable instead of formData
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.
I put it like that. But it is failing.
let formDataSingle;
// read form data if method was POST
if (c.request.method === 'post') {
let formData = {};
const form = new IncomingForm();
formData = (await form.parse(req))[0];
formDataSingle = firstValues(form, formData);
}
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.
What is failing exactly ?
In 3 days I will have a bit of time maybe I will try to see what is wrong with this PR by trying out locally
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 for the help. That was the run: https://github.com/ether/etherpad-lite/actions/runs/5672397436/job/15371523032?pr=5796 . I turned on debug level but there is still only the diff of the texts.
So it seems like there is not a lot of error handling/output in that corner of etherpad.
I noticed that Linux/Darwin + NPM6 works best for running etherpad. Windows is kind of buggy.
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.
@GrosSacASac Could you find some time to check why your suggestion with firstValue doesn't work? It might be interesting to learn why your suggestions seems to not work.
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.
I am on a trip now
4ef1f0e
to
15d4f87
Compare
Bumps formidable from 2.1.2 to 3.5.0.
Release notes
Sourced from formidable's releases.
Changelog
Sourced from formidable's changelog.
... (truncated)
Commits
You can trigger a rebase of this PR by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)