This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
Refactor backend state store #319
Labels
domain: backend
On the backend
stage: dev
On/for a development version
type: feature
Brand new functionality, features, pages, workflows, endpoints, etc.
type: fix
Iterations on existing features or infrastructure
work: obvious
The situation is simple/obvious/clear, best practices used
Milestone
Currently the backend's state store is a dict associating protobuf message types as keys to protobuf message instances as values. This leads to an awkward type system (as accessing state segments in the store requires a typecast). We should instead make the backend state store more like the firmware state store, where state segment objects are statically typed, but still are accessed by indexing on a value (either a protobuf message type, or as will be done in #313, a StateSegment enum; this might also require moving state input from the StateSynchronizer protocol into the Backend protocol, like what we do in the firmware).
One option might be to define a Store class (or dataclass) with members, and to define a custom way of accessing members by passing in an enum.
The text was updated successfully, but these errors were encountered: