Missing 'Broadcast' module in Zammad WebSocket After Migration from 5.2.1

Infos:

  • Used Zammad version: 5.2.1 and 5.4.1
  • Used Zammad installation type: source
  • Operating system: Linux

Expected behavior:

  • When sending a message via WebSocket with the following format: {"event":"broadcast","spool":true,"data":{"event":"ticket":"%s","data":"%s"}}
    is succesfully sent. The message should be broadcasted to all connected users, where %s represents the actual data to be sent.

Actual behavior:

  • after attempting to send the message, an error response is received:
    [{"event":"error","data":{"error":"No such event broadcast: #\u003cNameError: uninitialized constant Sessions::Event::Broadcast\n\n candidate = constant.const_get(name)\n ^^^^^^^^^^\u003e","payload":{"event":"broadcast","spool":true,"data":{"message":"CUSTOM MESSAGE"}}}}]

Steps to reproduce the behavior:

  • connect to running zammaw websocket for example (wscat -c wss://my-zammad.xyz/ws)
  • send a message {ā€œeventā€:ā€œbroadcastā€,ā€œspoolā€:true,ā€œdataā€:{ā€œmessageā€:ā€œCUSTOM MESSAGEā€}}

The error message indicates that there is no event named ā€œbroadcastā€ available in the current context. It specifically mentions a ā€œuninitialized constant Sessions::Event::Broadcastā€ error, suggesting that the Sessions::Event::Broadcast event may not be defined or accessible.

Hi everyone,

I recently performed a migration of my Zammad instance from version 5.2.1 to 5.4.1, and while the process overall went smoothly, I encountered some changes in the WebSocket functionality.

Specifically, it seems that the ability to broadcast messages to all connected users using the ā€œbroadcastā€ event is no longer available (commit when the module is deleted).

Previously, I used to send messages via WebSocket with the described above, however, after the migration, attempts to send messages with the ā€œbroadcastā€ event result in an error response indicating that the event is not recognized.

Iā€™m curious to know if the ā€œbroadcastā€ event functionality has been intentionally removed, or if there are alternative methods or workarounds available to achieve similar functionality in Zammad versions after 5.3.0?

Additionally, I would greatly appreciate any documentation updates or guidance that can help me understand these changes better and adapt our workflows accordingly. Are there any release notes, migration guides, or updated API documentation available that cover these changes in detail?

Thank you all for your attention to this matter, and I look forward to your insights and responses.

Kind regards,

Evgeny USACHEV

Hi,

this feature was removed, because of security reasons: Maintenance: Improve session takeover handling. Ā· zammad/zammad@8103fc5 Ā· GitHub

It was also never really used in the code base. The question would be, what problem do you want so solve?

Maybe some existing events can be used, but currently, there is no idea of the possibility of custom events.

Also with the technical rewrite and the usage of the action cable the complete old web socket server will be dropped at some point.

1 Like

Hi Dominik,

Thank you for your quick and detailed answer. I just wanted to know if this functionality has been moved or completely removed. Your answer will help me proceed with my project without having to search for the missing functionality.

I used the WebSocket ā€˜broadcastā€™ module of Zammad for my own purposes in a project, but I was aware that one day I might need to create my own WebSocket server to meet the specific needs of my project, which are not directly related to Zammad. Iā€™m now working on my own WebSocket service, which anyway was on the schedule but without a specified date.

Best regards,

Evgeny

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