-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
This feature is mainly important for billing and also directly was addressed by haverboecker.
Billing run needs the full state history to be able to add consumed usage of the past to the current bill.
The agent should call a backend function (no publish) and transmit the app state history consisting of
- device_key
- release_key
- state
- transition time as timestamp (millisecond resolution like timestamp in postgres)
When the function call returns "success", then the records that have been transfered should be removed from the local sqllite db by the agent. The function should be called before the agent starts the downstream sync with the backend to avoid weird behavior!
Note that the corresponding postgres function has to make sure that contradicting histories of two different physical devices with the same device config do not collide!