Trigger node - stuck RESET not working?

I seem to be losing my ability to read.

This is the bit of code:

[
    {
        "id": "d6ed3ea3758e7956",
        "type": "inject",
        "z": "26262ba1.62dcbc",
        "name": "Reset",
        "props": [
            {
                "p": "reset",
                "v": "reset",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 2600,
        "y": 6090,
        "wires": [
            [
                "e031db0c1b449082"
            ]
        ]
    },
    {
        "id": "ba2e5d8d78dc9049",
        "type": "inject",
        "z": "26262ba1.62dcbc",
        "name": "Reset",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "reset",
        "payloadType": "str",
        "x": 2600,
        "y": 6130,
        "wires": [
            [
                "e031db0c1b449082"
            ]
        ]
    },
    {
        "id": "e031db0c1b449082",
        "type": "junction",
        "z": "26262ba1.62dcbc",
        "x": 2690,
        "y": 6110,
        "wires": [
            [
                "e6b08c85efe7f4a0"
            ]
        ]
    },
    {
        "id": "e6b08c85efe7f4a0",
        "type": "trigger",
        "z": "26262ba1.62dcbc",
        "name": "Timer",
        "op1": "on",
        "op2": "off",
        "op1type": "str",
        "op2type": "str",
        "duration": "250",
        "extend": false,
        "overrideDelay": true,
        "units": "ms",
        "reset": "reset",
        "bytopic": "topic",
        "topic": "topic",
        "outputs": 1,
        "x": 2620,
        "y": 6350,
        "wires": [
            [
                "28dea75b3e5b1aec",
                "39698f31cc2c1ac7"
            ]
        ]
    }
]

NEITHER of the reset inject nodes reset it if it is running.

Why not?
I'm sending a msg.reset
I ticked the if msg.payload == and set it to reset and send that.

OBSERVATION

This example handles different topics.

If I untick that: it works and the reset works.

New example code showing both ways.

[{"id":"f590dc16c5aa0177","type":"trigger","z":"26262ba1.62dcbc","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"250","extend":false,"overrideDelay":true,"units":"ms","reset":"","bytopic":"topic","topic":"topic","outputs":1,"x":3900,"y":6320,"wires":[[]]},{"id":"3abdb00e854c6371","type":"inject","z":"26262ba1.62dcbc","name":"Can't reset","props":[{"p":"payload"},{"p":"delay","v":"20000","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic","payload":"foo","payloadType":"str","x":3700,"y":6320,"wires":[["f590dc16c5aa0177"]]},{"id":"56480dde8153495e","type":"inject","z":"26262ba1.62dcbc","name":"reset","props":[{"p":"reset","v":"reset","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":3710,"y":6270,"wires":[["f590dc16c5aa0177"]]},{"id":"9ae784ad56707ebd","type":"inject","z":"26262ba1.62dcbc","name":"reset","props":[{"p":"reset","v":"reset","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":3710,"y":6370,"wires":[["7ae631ad1aa4f971"]]},{"id":"7ae631ad1aa4f971","type":"trigger","z":"26262ba1.62dcbc","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"250","extend":false,"overrideDelay":true,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":3900,"y":6420,"wires":[[]]},{"id":"dd6953b24c6d4da0","type":"inject","z":"26262ba1.62dcbc","name":"CAN reset","props":[{"p":"payload"},{"p":"delay","v":"20000","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic","payload":"foo","payloadType":"str","x":3700,"y":6420,"wires":[["7ae631ad1aa4f971"]]}]

BUG?

I have not looked at your flow, but if you have told it to use different topics then presumably you need to set the correct topic with the reset message for the topic that you wish to reset. Have you done that?

Since the trigger node is maintaining a queue for each topic, I guess it makes sense that you can reset an individual queue by passing a message with msg.topic and msg.reset.

It does not seem to be possible to cancel the queue for all topics, neither by passing a message with no msg.topic, nor with msg.topic as some magic value such as a blank string or array of strings.

The documentation is very clear:
If the node receives a message with a reset property, or a payload that matches that configured in the node, any timeout or repeat currently in progress will be cleared and no message triggered.

That is not what happens, so yes you have uncovered a bug in a core node. Congratulations!

1 Like

I think it is a bug in the docs. It should define better what happens when topic mode is selected.

Though you could argue that the text

Optionally, the node can be configured to treat messages as if they are separate streams, using a msg property to identify each stream. Default msg.topic.

Implies that all messages are to be streamed by the topic, including those containing msg.reset. There is certainly no harm in adding a few words to the reset paragraph to make it clear though. As usual, no doubt, a PR to improve the docs would be very welcome.

1 Like

Go for it.

Personally I think Andrew has highlighted a bug in the software, that there is no [documented] way for a single message to reset all queued topics.

@Trying_to_learn submit a feature request on node red asking for msg.reset to clear all streams if there is no msg.topic.

1 Like

Makes sense to me that it should reset all if topic not specified.

1 Like

Thanks. Now I'll go down the bug submission rabbit hole.

:wink:

I just wanted to check if it was just a documentation problem or an actual problem with the code.

Yes, I can see the two lines of thought on how it should be handled.
And if I am using topic controlled times, that reset maybe shouldn't clear all.

But to me, reset is reset.