Refactor JSON serialization for WebSocket responses

- Switched to using the compact JSON5 encoder for improved transport efficiency while preserving NaN/Infinity values in WebSocket subscription responses.
- Updated comments for clarity on the changes made to the serialization process.
This commit is contained in:
Joe 2026-01-23 06:43:59 -06:00
parent 7c6c4a0e85
commit 9692c843e7

View file

@ -554,8 +554,8 @@ async fn handle_websocket_subscription(
}),
};
// Use json5 to preserve NaN/Infinity values
json5::to_string(&response)?
// Use compact JSON5 encoder for transport efficiency, preserves NaN/Infinity
json::to_string_compact(&response)?
};
log::debug!("Sending batch of messages over WebSocket subscription");