From 2adebf82ca3d66a0fff5d9ef7686c7890acb9c05 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Tue, 26 May 2026 14:45:09 +0200 Subject: [PATCH] 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 --- gui_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui_client.py b/gui_client.py index bfbdebd..21a7ad6 100644 --- a/gui_client.py +++ b/gui_client.py @@ -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: