This diff introduces an update of the device's online state in the database when the ping message or the payload message write was unsuccessful.
This is a part of the stack.
Related Linear task: [[ https://linear.app/comm/issue/ENG-1766/make-sure-the-device-is-offline-to-send-a-notification-to-wake-it-up | ENG-1766 ]]