Device shadow event synchronization fails after device reconnection

After devices reconnect to Watson IoT Platform wiot-25 following a network disconnection, the device shadow events are not synchronizing properly. The shadow manager shows outdated device state even though devices are sending updated state events after reconnection.

The shadow event format we’re using:

{"state": {"reported": {"temperature": 22.5, "status": "online"}}}

Devices reconnect successfully (connection status shows “connected”), but the shadow state remains stuck at the last value before disconnection. We’ve tried manually refreshing the shadow from the dashboard, which temporarily fixes it, but the next automatic sync fails again. Is there a reconnect detection mechanism that needs to be configured for shadow event processing?

I implemented the sync request in our device firmware and tested it. The shadow manager now responds after reconnection, but I’m still seeing state synchronization failures for about 40% of reconnections. The shadow manager logs show “duplicate state event ignored” errors. Could this be because devices are sending state updates too quickly after the sync response?

Device shadows in wiot-25 require explicit synchronization commands after reconnection. The automatic sync only works for devices that maintain persistent connections. When a device reconnects, it needs to send a shadow sync request first, then publish updated state events. Check if your devices are sending the sync request after reconnection.

Our devices aren’t sending explicit sync requests - they just start publishing state events immediately after reconnection. Should we add a sync request to the reconnection logic? What’s the correct format for the shadow sync request in wiot-25? The documentation mentions it but doesn’t provide clear examples.

The “duplicate state event ignored” error happens when the shadow manager receives state updates with the same version number. After reconnection, devices need to increment their state version number or use the version from the sync response. Check if your devices are tracking state version correctly across reconnections. Also add a small delay (500ms-1s) between receiving the sync response and publishing new state updates.