Hi,
I can’t get frappe.publish_realtime()
to do anything. I’ve been browsing the forums for the last several hours, but I haven’t uncovered any leads that help me figure out what’s going wrong.
I have this code on the server:
frappe.publish_realtime('gang_process',
{'task_id': 1, 'foo': 'bar'},
user=frappe.session.user)
frappe.msgprint('done')
On the client, I have this:
console.log('setup realtime');
frappe.realtime.on('gang_process', (data) => {
console.log('data', data);
});
Both code blocks trigger when I press a button. I expect to see this in the browser console:
setup realtime
data {'task_id': 1, 'foo': 'bar'}
in the browser console, as well as a frappe message box with the word “past” in it. All I see is setup realtime
and the messagebox, with no indication error or indication of any kind that frappe.publish_realtime()
did anything at all.
Environment
I’m running ERPNext 12 in development mode. On the suggestion from one of the forums, I ran
bench setup socketio
bench build
after which I restarted the server and refreshed the page. Nothing changed.
Any help would be appreciated!