gui_client: fix diff mode display corruption via deepcopy on emit

jay_merge_full/jay_merge_update mutates _state nested dicts in place.
The previously emitted dict(_state) was a shallow copy sharing those
nested dicts, so background-thread merges retroactively corrupted
already-emitted snapshots: timestamps were correct (strings are
immutable) but Y values all converged to the latest record's values.

Fix: emit copy.deepcopy(_state) so each snapshot is fully independent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 14:45:09 +02:00
co-authored by Claude Sonnet 4.6
parent 56ed4ac265
commit 2adebf82ca
+2 -1
View File
@@ -13,6 +13,7 @@ Plot — time-series charts of all physical {value, unit} fields
import json
import socket
import copy
import sys
import threading
import time
@@ -163,7 +164,7 @@ class TcpReader(QObject):
self._state = jay_merge_full(self._state, diff)
else:
self._state = data
self.message.emit(dict(self._state))
self.message.emit(copy.deepcopy(self._state))
else:
self.message.emit(data)
except json.JSONDecodeError: