PersistenceManager
Singleton persistence manager for managing persisted payloads.
Functions
After a successful push of persisted outbound data, removes only flushedPendingHeartbeats and flushedPayload chunk prefixes from disk. Merges that appended after the snapshot remain. Returns false if the file exists but no longer has those exact prefixes (nothing is written).
Delete the persisted payload from the device for a specific device ID.
Delete the persisted payload from the server for a specific device ID.
Fetch all device-generated persisted payloads.
Fetch all persisted server-issued payloads.
Fetch persisted payloads from the server for a specific device ID.
Merges heartbeats with stored ciphertext and propagates any storage error.
Merges new ciphertext with stored device data, then propagates any storage error.
Encodes device payloads with pending heartbeats, then propagates any storage error.
Encodes a server payload, then replaces its stored copy and propagates any storage error.
Removes stale server state updates for a device, based on its current DSC and SSC.
Reset all persisted data by deleting the directory contents.