Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #932 Fixed #1

Merged
merged 32 commits into from
Jan 1, 2024
Merged

Issue #932 Fixed #1

merged 32 commits into from
Jan 1, 2024

Conversation

nagu165
Copy link
Owner

@nagu165 nagu165 commented Jan 1, 2024

Problem

When editing a file system, the form shows a disabled selector for the mount point field. Using a disabled widget does not make sense in this case because the mount point will never be editable. The disabled widget should be replaced by plain text.

Moreover, the selector currently uses a FormSelect component. It should be replaced by the Select component, similar to the file system type selector.

Solution

  • Fixed the issue of the mount point field by rendering the text via the html p tag.
  • The FormSelect component at L77 was replaced by the Select component.

I am new to open-source contributions so I don't know how to test the react components properly. Sorry for the inconvenience.

I wanted to attach screenshots too but I'm having a problem setting up the project using Virtual Machine.

imobachgs and others added 30 commits December 26, 2023 08:54
Co-authored-by: Knut Alejandro Anderssen González <[email protected]>
## 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.
Agama-weblate commit: 2ad365d9d13ef872b40b5aa4fb5bd4e99f104def
Updating the service translation files from the agama-weblate repository
- Fix several issues detected by Clippy.
- Rename agama-dbus-server "locale" to "l10n" (to avoid
`locale/locale`).
- Define some 'types' for D-Bus proxies to make easier to read the code.
- Run Clippy in the continuous integration.
Agama-weblate commit: d0322d40d617c6790d5a2767fd47ca98ff25f3e0
Updating the service translation files from the agama-weblate repository
* It prevents a "future cannot be sent between threads safely" error.
* Drop the ObjectsRegistry mutex and use message passing.
* Use `async_trait` in the network Adapter trait, although it should not
be needed in version 1.75 (another PR would follow).
* Set the minimal version to 1.74.
* Improve ServiceError messages.
Updating the tree must be done in a separate task. Otherwise, it could
fight with an incoming request for the ObjectServer mutex, blocking the
actions dispatching.
## Problem

If the network service receives an `Apply` at the same time as any other
request, it may get blocked.

## Solution

Updating the tree must be done in a separate task. Otherwise, it could
fight with an incoming request for the ObjectServer mutex, blocking the
actions dispatching.

## Using tokio-console

I decided to use
[tokio-console](https://docs.rs/tokio-console/latest/tokio_console/) to
make it easier to find the problem. This tool collects and displays
information about the asynchronous tasks in your program. In the
screenshot below you can see that the D-Bus `Set` dispatchers are
blocked.

![Captura desde 2023-12-29
10-52-45](https://github.com/openSUSE/agama/assets/15836/648e5f1e-eb6b-431b-be40-45cdeaf9e980)

Once you find the problem, it is kind of "obvious", but it may take some
time until you figure out what is happening.

To use `tokio-console` you need to add some instrumentation to your
program and, at this point, it implies adding some unstable Tokio APIs.
So if you want to give it a try, you can try the code in the
[tokio-console
branch](https://github.com/openSUSE/agama/compare/tokio-console).
@nagu165 nagu165 merged commit f8f95ff into nagu165:issue#932 Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants