Mqtt, json, Abnormal data cleaning

hello everyone! When I use MQTT to send data from the edge gateway in JSON format, if the communication between the edge gateway and MQTT broker, as well as between the ignition and MQTT broker, is normal, the data is fine. However, if any of the following situations occur, the previously subscribed data is no longer accurate, and putting the data on the screen may cause confusion among operators. What should I do? Please advise everyone.

1: The edge gateway experiences an abnormal power outage and sends a message "OFFLINE" to a topic in MQTT broker through a will message;
2: Interrupted when communication between Ignition and MQTT Broker is normal