Skip to content
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

Merged
merged 2 commits into from
Aug 5, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jun 29, 2023

Bumps formidable from 2.1.2 to 3.5.0.

Release notes

Sourced from formidable's releases.

v3.2.5

No release notes provided.

3.2.4

No release notes provided.

3.1.4

https://github.com/node-formidable/formidable/blob/master/CHANGELOG.md

Changelog

Sourced from formidable's changelog.

3.5.0

  • feature: (#944) Dual package: Can be imported as ES module and required as commonjs module

3.4.0

  • feature: (#940) form.parse returns a promise if no callback is provided
  • it resolves with an array [fields, files]

3.3.2

  • feature: (#855) add options.createDirsFromUploads, see README for usage
  • form.parse is an async function (ignore the promise)
  • benchmarks: add e2e becnhmark with as many request as possible per second
    • npm run to display all the commands
  • mark as latest on npm

3.2.5

  • fix: (#881) fail earlier when maxFiles is exceeded

3.2.4

  • fix: (#857) improve keep extension
  • The code from before 3.2.4 already removed some characters from the file extension. But not always. So it was inconsistent.
  • The new code cuts the file extension at the first invalid character (invalid in a file extension).
  • The characters that are considered invalid inside a file extension are all except the . numbers and a-Z.
  • This change only has an effect if filename option is not used and keepextension option is used

3.2.3

  • fix: (#852) end event is emitted once

3.2.2

3.2.1

  • fix: do not let empty file on error (#796)
  • it was probably due to the fact that .destroy on a file stream does not always complete on time

3.2.0

  • feat: maxFileSize option is now per file (as the name suggests) (#791)

... (truncated)

Commits

Dependabot compatibility score

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)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Jun 29, 2023
@JohnMcLear
Copy link
Member

@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]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/src/formidable-3.5.0 branch from b6db046 to 3f079e6 Compare July 5, 2023 09:42
@JohnMcLear
Copy link
Member

@JohnMcLear
Copy link
Member

I hackified the files[0] issue but I'm seeing openAPI is being weird now. I think it's due to the size of the text value in the test.

  1) /home/jose/etherpad-lite/src/tests/backend/specs/api/pad.js
       Tests
         Sets text on a pad Id:

I need to stop now as I have other things to do but hopefully someone can pick it up from here.

@SamTV12345
Copy link
Member

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.

@JohnMcLear
Copy link
Member

@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.

@SamTV12345
Copy link
Member

I asked the formidable maintainers. Maybe they can help us: node-formidable/formidable#946 .

@webzwo0i webzwo0i force-pushed the dependabot/npm_and_yarn/src/formidable-3.5.0 branch from 6d3e8ea to 15d4f87 Compare July 24, 2023 00:37
@webzwo0i
Copy link
Member

webzwo0i commented Jul 24, 2023

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

@webzwo0i
Copy link
Member

The conversion when using multipart/form-data is strange, as it only picks the first element. But it should work across our API.

@webzwo0i
Copy link
Member

webzwo0i commented Jul 24, 2023

in superagent we sometimes use .send(json payload) or .field({})/multipart/form-data. The first is serialized as-is, the latter is converted to key: [value], so we must get rid of the Array.

const form = new IncomingForm();
formData = (await form.parse(req))[0];
for (const k of Object.keys(formData)) {
if (formData[k] instanceof Array) {

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

Copy link
Member

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.

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);

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

Copy link
Member

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);
          }

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

Copy link
Member

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.

Copy link
Member

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.

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

@SamTV12345 SamTV12345 force-pushed the dependabot/npm_and_yarn/src/formidable-3.5.0 branch from 4ef1f0e to 15d4f87 Compare July 26, 2023 18:31
@SamTV12345 SamTV12345 merged commit 4da66d1 into develop Aug 5, 2023
@SamTV12345 SamTV12345 deleted the dependabot/npm_and_yarn/src/formidable-3.5.0 branch August 5, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants