Skip to content

‘widget-action’ messages set msg.topic to ‘undefined’ #1683

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

Open
omrid01 opened this issue Apr 23, 2025 · 0 comments
Open

‘widget-action’ messages set msg.topic to ‘undefined’ #1683

omrid01 opened this issue Apr 23, 2025 · 0 comments
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do

Comments

@omrid01
Copy link

omrid01 commented Apr 23, 2025

Current Behavior

I have upgraded my dashboard-2 to v1.23.0.

In my custom UI node, when I send messages as 'widget-action' (this.$socket.emit('widget-action', this.id, msg)), their topic property is getting overrun and becomes undefined.

This happens also in the generic ui-template node. Using this.send(msg) works OK, but using emit to 'widget-action' overwrites the topic property.
For example, injecting a msg with msg.topic='myTopic' to the template:

mounted() {
	const $scope = this;

	// Socket listener
	this.$socket.on('msg-input:' + this.id, function(msg) {

		msg.payload = "Using 'emit'";
		$scope.$socket.emit('widget-action', $scope.id, msg);

		msg.payload = "Using 'send'";
		$scope.send(msg)
	});
}

returns the following result:
Image
This was not happening on previous dashboard versions.

Expected Behavior

msg.topic should not be overwritten

Steps To Reproduce

set a msg.topic value, and emit a message to 'widget-action' using $socket.emit('widget-action', this.id, msg)

Environment

  • Dashboard version: 1.23.0
  • Node-RED version: 4.09
  • Node.js version: 22.14.0
  • npm version: 11.1.0
  • Platform/OS: Windows
  • Browser: Edge

Have you provided an initial effort estimate for this issue?

I can not provide an initial effort estimate

@omrid01 omrid01 added bug Something isn't working needs-triage Needs looking at to decide what to do labels Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
Status: Backlog
Development

No branches or pull requests

1 participant