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

form: exclude own metadata, append result instead of overwriting #1686

Merged
merged 5 commits into from
Jul 3, 2019

Conversation

arturi
Copy link
Contributor

@arturi arturi commented Jun 21, 2019

This PR does 2 things:

  1. Excludes the upload result metadata that Form appended to a <form> element, when gathering metadata from that form. Addresses ASSEMBLY_SATURATED when re-picking a file for robodog's form integration #1637, where because of this issue we were sending a huge amount of metadata to tusd — the whole complete object, instead of metadata intended by the user/dev.
  2. Appends subsequent results to an array, instead of overwriting previous result. This fixes Form plugin only appends last success #1147, but it is also probably a breaking change, since before this new results were just overwriting the previous, and the value sent to the server was an object, now it’s an array.

@arturi arturi requested review from goto-bus-stop and kvz June 21, 2019 15:48
@goto-bus-stop
Copy link
Contributor

The 1st thing LGTM 👍 . We could land it first and publish as a patch, then nobody has to worry about upgrading.

@arturi
Copy link
Contributor Author

arturi commented Jun 24, 2019

I could also add the second thing as an option, appendNewResult: true (or invert replaceResult: false), it would be opt-in, and we make it default in 2.0?

@goto-bus-stop
Copy link
Contributor

i could live with that :P

@arturi
Copy link
Contributor Author

arturi commented Jun 28, 2019

@goto-bus-stop updated, please take a look 🙏

Copy link
Contributor

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation LGTM

@@ -23,6 +23,7 @@ module.exports = class Form extends Plugin {
resultName: 'uppyResult',
getMetaFromForm: true,
addResultToForm: true,
replaceResultInFormWithNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚲 🏚️ , but maybe the default option should be multipleResults: false or combineMultipleResults: false? i feel like replaceResultInFormWithNew is very verbose but also doesn't immediately clarify what it's for.

@arturi arturi force-pushed the form-exclude-own-meta branch from 3d63a2c to 42032aa Compare July 3, 2019 14:05
@arturi arturi force-pushed the form-exclude-own-meta branch from 42032aa to f68059e Compare July 3, 2019 15:20
@arturi arturi merged commit ae49cef into master Jul 3, 2019
@delete-merged-branch delete-merged-branch bot deleted the form-exclude-own-meta branch July 3, 2019 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Form plugin only appends last success
2 participants