From 22b9df62d1b7fb2aaf40ac7f1dd307fbde6cdbbb Mon Sep 17 00:00:00 2001 From: juggledad Date: Fri, 25 Oct 2019 09:51:50 -0400 Subject: [PATCH] =?UTF-8?q?Using=20the=20=E2=80=98a=20msg=20per=20line?= =?UTF-8?q?=E2=80=99=20the=20last=20line=20does=20not=20get=20msg.topic=20?= =?UTF-8?q?passed=20(#2352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using the file-in node and ‘a msg per line’ the last line does not get msg.topic passed. In the .on(‘end’, function() { code (starting at line 334) the msg is created but no msg.topic is set. Adding topic:msg.topic, after line 343 (var m = { payload: spare,) fixes the issue. --- packages/node_modules/@node-red/nodes/core/storage/10-file.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/node_modules/@node-red/nodes/core/storage/10-file.js b/packages/node_modules/@node-red/nodes/core/storage/10-file.js index c27c3ed5f..54ce55764 100644 --- a/packages/node_modules/@node-red/nodes/core/storage/10-file.js +++ b/packages/node_modules/@node-red/nodes/core/storage/10-file.js @@ -341,6 +341,7 @@ module.exports = function(RED) { } else if (node.format === "lines") { var m = { payload: spare, + topic:msg.topic, parts: { index: count, count: count+1,