-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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(core & function nodes): Update function nodes to work with binary-data-mode 'filesystem'. #3845
fix(core & function nodes): Update function nodes to work with binary-data-mode 'filesystem'. #3845
Conversation
Looks good from what I can see. Would be great if you could finish what you think is still outstanding and we can then review. Thanks a lot for taking care of that. Is very appreciated! |
getNodeParameter: this.getNodeParameter, | ||
getWorkflowStaticData: this.getWorkflowStaticData, | ||
helpers: this.helpers, | ||
item: item.json, | ||
setBinaryData: (data: IBinaryKeyData) => { | ||
getBinaryDataAsync: async (): Promise<IBinaryKeyData | undefined> => { |
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.
getBinaryDataAsync: async ()
The Function
node requires one to pass in the item here. It isn't necessary in the FunctionItem
node, however perhaps we should align the two for better a better user experience when switching between them? Though - to be honest - I quite like it this way if we think about the nodes independently.
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.
Just some code style things to consider. Also, I agree we need tests for this feature.
Thanks for the contribution! We're tracking it internally under N8N-4435 and will be looking into it shortly. |
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.
Looks good to me!
Thank you very much for the contribution @rhyswilliamsza ! |
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.
Looks good to me 👍
Apologies, I have been away and just got back to this. Thank you for merging! |
Got released with |
…-data-mode 'filesystem'. (n8n-io#3845) * Initial Fix * Self-Review n8n-io#1 * Lint * Added support for FunctionItem. Minor updates. * Self-review * review comments. Added testing. * Self Review * Fixed memory handling on data manager use. * Fixes for unnecessary memory leaks.
Hello! 👋
This is a PR addressing issue #3618.
Added ✨
NodeExecuteFunctions.ts
,setBinaryDataBuffer(data: IBinaryData, binaryData: Buffer): Promise<IBinaryData>
, which allows a node to store binary data when theIBinaryData
object already exists. Previously, one had to recreate this object usingprepareBinaryData
.FunctionItem
&Function
nodes:getBinaryDataAsync(...)
helper method has been added. This uses the configured BinaryDataManager to retrieve binary data.FunctionItem
&Function
nodes:setBinaryDataAsync(...)
helper method has been added. This uses the configured BinaryDataManager to store binary data.Deprecated 🙅
FunctionItem
node:getBinaryData(...)
has been deprecated. Users should migrate togetBinaryDataAsync(...)
instead.FunctionItem
node:setBinaryData(...)
has been deprecated. Users should migrate tosetBinaryDataAsync(...)
instead.