Steps to reproduce
- Create a 3 step flow of the following form:
-
Code component with
this input code
async function run(msg, cfg, snapshot) {
const urlRequest = await request({
url: 'https://api.elastic.io/v2/resources/storage/signed-url',
method: 'POST',
auth: {
username: process.env.ELASTICIO_API_USERNAME,
password: process.env.ELASTICIO_API_KEY
}
});
const url = JSON.parse(urlRequest.body).get_url;
const putRequest = await request({
url,
method: 'PUT'
});
this.emit('data', {body: {
url
},
attachments: {
'file.xml': {
url
}
}
});
}
- XML component: XML Attachment to JSON
- Pattern to match files:
.
- Email component: send email
- To:
- Subject:
Test
- Body:
Test
- Publish the flow and run it once.
Expected Result
XML component throws an error since the attachment contains the empty string which is not valid XML.
Actual result
An error badge appears around the email component: Cannot use 'in' operator to search for 'elasticio' in null
This Sailor bug is partially to blame for the above behavior: elasticio/sailor-nodejs#64
Steps to reproduce
Code component with
this input code
async function run(msg, cfg, snapshot) {
const urlRequest = await request({
url: 'https://api.elastic.io/v2/resources/storage/signed-url',
method: 'POST',
auth: {
username: process.env.ELASTICIO_API_USERNAME,
password: process.env.ELASTICIO_API_KEY
}
});
const url = JSON.parse(urlRequest.body).get_url;
const putRequest = await request({
url,
method: 'PUT'
});
this.emit('data', {body: {
url
},
attachments: {
'file.xml': {
url
}
}
});
}
.TestTestExpected Result
XML component throws an error since the attachment contains the empty string which is not valid XML.
Actual result
An error badge appears around the email component:
Cannot use 'in' operator to search for 'elasticio' in nullThis Sailor bug is partially to blame for the above behavior: elasticio/sailor-nodejs#64