# Why debug node can only show 'msg' message?

**URL:** <https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613>\
**Category:** General\
**Created:** [19 June 2020 13:38 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613 "2020-06-19T13:38:49Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [21 June 2020 08:29 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613/21 "2020-06-21T08:29:53Z")

</div>

The conversation has gone more or less of topic but... I am not entirely convinced about the use of join node to replace context storage for all situations. As it stores the values sent from different sources, it is basically a context storage itself but without the ability to see what it holds at a given point without making it trigger the flow followed by it.

I for example have conditions depending on movement detection, amount of ambient light in the room and the current state of a smart light. I could add link in nodes before it to pass in the newest values for ambient light and the light state but it just feels much more convenient having the latest sensor/light values in the global state. I can the just check prefilled `state.lifx['Livingroom ceiling']` or `state.binary.allLightsOff` where ever I might need them.

Edit: Sorry @knolleary, I was writing while you commented meanwhile. Agree completely.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 June 2020 09:41 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613/22 "2020-06-21T09:41:07Z")

</div>

> [@knolleary](#):
>
> How do you then query the current state?
> 
> Yes MQTT can be used to notify you when something changes, but if you need a flow to be able to refer to the _current_ state, you need to have it stored somewhere accessible.
> 
> I'm sorry but MQTT is not a drop in replacement for context.

Just finally to say that I suggested _considering_ MQTT as often it is a good solution, rather than lots of link nodes or global context, and in fact I do virtually always use MQTT.  
As for how to refer to current state, use a Join node.  
If anyone wants to propose a particular problem where they think context is really better then I would love to have the possibility of being convinced, so please start a new thread with such a problem.

---

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [21 June 2020 17:46 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613/23 "2020-06-21T17:46:24Z")

</div>

Nice idea, the context view suggestion. Oh, the reference to multiple GOTO statements in BASIC... I almost spit out my soda, too funny.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 June 2020 19:35 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613/24 "2020-06-21T19:35:15Z")

</div>

> [@Colin](#):
>
> Which brings me back to my favourite hobby horse, one of the major issues with using context is that there is no way of knowing when a value is updated other than polling it.

This actually brings us onto a wider issue that I'm hoping we can discuss when the next release is out of the way.

That is more extensive use of events in Node-RED. It should be really easy to extend the context handler to issue events when using the proper `set` function. Then it would be equally easy to have a listener node that fired a msg when a variable is updated.

That is only one area in which wider use of events might be very powerful in Node-RED.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 June 2020 19:41 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613/25 "2020-06-21T19:41:44Z")

</div>

> [@Nodi.Rubrum](#):
>
> Frankly, I just don't understand why it can't just be done, add global and flow to debug along with msg, regardless of the various options and solutions noted above... It just really would be the most user friendly straight forward thing to do IMHO.

This comment seems to have been overlooked.

It comes back to a question of priorities, time and resources. Quite possibly if you were to discuss adding the code to make that happen, Nick and Dave might be willing to accept a PR - or there might be other reasons for not doing it. They are the experts at the internals of Node-RED and so you need to start with them.

But at the moment, it is just them doing the majority of the development work (with help I know from others from time-to-time, including Hitachi) and there are only so many hours in the day.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 June 2020 21:19 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613/26 "2020-06-21T21:19:29Z")

</div>

> [@TotallyInformation](#):
>
> brings us onto a wider issue

off-topic - please start this in another thread.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 June 2020 21:22 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613/27 "2020-06-21T21:22:52Z")

</div>

Yes, a pull request to simplify this could be considered. It won't get rushed into 1.1.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 July 2020 21:22 UTC](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613/28 "2020-07-05T21:22:55Z")

</div>

Closed on 5 July 2020 21:22 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/why-debug-node-can-only-show-msg-message/28613.md?page=1)
