Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve D-Bus network interface (#961)
## Problem Until now, the communication between our network model and its D-Bus interface worked only in one direction (from D-Bus to the model). And that was pretty limiting. ## Solution In #885 we introduce the usage of `oneshot::channel()` to enable bi-directional communication between the model and the D-Bus interface. It worked rather well, so it is time to extend this approach. Some use cases that are covered: * Perform a complex validation in the model (considering the whole model) and return the result to the D-Bus interface. * Return the D-Bus path of a new connection (implemented in this PR). But there is another interesting implication: the model is the single source of truth (no more cloned data in the interface). In the future, we are expected to listen to NetworkManager and update some parts of our model accordingly. Not having to replicate that information to D-Bus (except when new things add or disappear) makes things easier. Note: `org.opensuse.Agama1.Network.Device` and `org.opensuse.Agama1.Network.Devices` are excluded by now. ## Testing - *Added a new unit test* - *Tested manually* ## To do - [x] Reduce the boilerplate associated to the usage of channels.
- Loading branch information