[Bug] WebSocket JSON Serialization Failure Causes UI Data Loss

Author: LolitaIceMiaCreated Dec 7, 2025Updated Jun 9, 2026

Description

The WebSocket server-side code responsible for sending module data (i.e., moduleName and output) to the frontend Web UI uses manual string concatenation to build the JSON response. When the module's output contains special characters, particularly newlines (\n), double quotes ("), or control characters, this manual concatenation method breaks the resulting JSON string's syntax. This prevents the frontend JavaScript client from successfully calling JSON.parse(), leading to data failure, data corruption, or display errors in the dashboard.

Suggested Fix

Suggested Solution: Replace the manual JSON string concatenation logic in the WebSocket response code with standard object creation followed by JSON.stringify(responsePayload). Using JSON.stringify() ensures automatic and correct escaping of all data fields, guaranteeing valid JSON transmission. https://github.com/tariqbuilds/linux-dash/pull/520