Skip to content

Conversation

@jreidinger
Copy link
Contributor

@jreidinger jreidinger commented May 9, 2025

Problem

There is missing conflict resolution in Agama web UI.

Solution

Implement it with having it in backend, dbus, http API and also in web UI.

Testing

  • Added a new unit test at front-end side
  • Tested manually by @jreidinger

Screenshots

Click to show/hide a few screenshots

Bear in mind that these screenshots might be outdated because changes requested by reviewers after uploading them. They will be replaced only if these changes are highly noticeable

Warning with link at Software page

localhost_8080_ (65)

Software conflicts resolution page when there is only one conflict

localhost_8080_ (66)

Software conflicts resolution page when there are multiple conflicts

localhost_8080_ (64)

Software conflicts resolution page when there are no conflicts

localhost_8080_ (67)

@coveralls
Copy link

coveralls commented May 16, 2025

Coverage Status

coverage: 62.701% (-0.09%) from 62.794%
when pulling ddf7970 on conflicts
into 56edc07 on master.

@jreidinger jreidinger marked this pull request as ready for review May 16, 2025 15:27
dgdavid

This comment was marked as outdated.

Replaces "Solve it" with "Review and fix" to better reflect the action
required from users. The previous wording suggested an automatic fix,
while in reality users must choose one of several proposed solutions.

Also updates the link's appearance in the warning message by removing
the icon and using the `isInline` prop instead. This aligns it with
other links in the storage interface and ensures the design system
underlines it for better visibility.
@dgdavid
Copy link
Contributor

dgdavid commented May 21, 2025

@jreidinger I think UI internals are now in a better shape. A few unit tests were added, as well as some aesthetic changes.

Please, feel free to review these changes and make as much suggestions as needed.

Thanks!

@dgdavid dgdavid requested review from ancorgs, imobachgs and lslezak May 21, 2025 15:58
@dgdavid
Copy link
Contributor

dgdavid commented May 21, 2025

@jreidinger @imobachgs Sorry guys, but help needed with Rust part here.

I think I messed it up while merging master, although the needed change looked pretty straightforward to me. See f22ae09 and 3d039d9

dgdavid added 2 commits May 21, 2025 17:04
That was leaked in the conflicts mutation hook becuase copy&paste
Copy link
Contributor

@lslezak lslezak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor issues, but probably sending the complete data in the event is not a good idea.

return client.onEvent((event) => {
if (event.type === "ConflictsChanged") {
const { conflicts } = event;
queryClient.setQueryData([conflictsQuery().queryKey], conflicts);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it is a good idea to send the complete list of the conflicts as a part of the event via the web socket. There might be dozens of conflicts and sending them to all clients sounds too much to me. Not all clients might be interested in the details, like the agama monitor client.

I'd prefer no details in the event and let the client to fetch the data again if it needs them. With Tanstack query it is enough to invalidate the cache, it will re-fetch automatically.

Something like:

        queryClient.invalidateQueries({ queryKey: [conflictsQuery().queryKey] })

See https://tanstack.com/query/v5/docs/framework/react/guides/query-invalidation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. I didn't know why we were doing an optimistic update here and thought that there were a reason. But if no body opposes I'll go for the invalidation as you suggest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that apart of changing the frontend for just invalidating the query some changes are needed in the backend for not broadcasting all the conflicts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agama example:

if (type === "IssuesChanged") {
queryClient.invalidateQueries({ queryKey: ["status"] });
}
if (event.type === "ProductChanged") {
queryClient.invalidateQueries({ queryKey: selectedProductQuery().queryKey });
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. However, how big (in size) the list of conflicts can be? I would consider changing it only if it is a real problem. In general, I dislike those events where you need to do another fetch to get the real data, although I understand that in this case it could make sense.

However, I think that a proper solution would be to allow the subscribers to choose the "topics" they care about, so they only receive a lot of useless information. But we are not there yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the backend needs an update as well.

Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the Rust part.

return client.onEvent((event) => {
if (event.type === "ConflictsChanged") {
const { conflicts } = event;
queryClient.setQueryData([conflictsQuery().queryKey], conflicts);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. However, how big (in size) the list of conflicts can be? I would consider changing it only if it is a real problem. In general, I dislike those events where you need to do another fetch to get the real data, although I understand that in this case it could make sense.

However, I think that a proper solution would be to allow the subscribers to choose the "topics" they care about, so they only receive a lot of useless information. But we are not there yet.

@jreidinger jreidinger merged commit 9809892 into master May 22, 2025
16 checks passed
@jreidinger jreidinger deleted the conflicts branch May 22, 2025 15:00
@jreidinger jreidinger mentioned this pull request May 22, 2025
jreidinger added a commit that referenced this pull request May 22, 2025
Add forgotten changes to
#2348
@imobachgs imobachgs mentioned this pull request May 26, 2025
imobachgs added a commit that referenced this pull request May 26, 2025
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request May 27, 2025
https://build.opensuse.org/request/show/1280489
by user IGonzalezSosa + anag_factory
- Version 15

- Proper handling of WebSocket secure connections (gh#agama-project/agama#2391):
  - "agama monitor" does not use "insecure" by default.
  - Do not encrypt the connection when using ws: URLs.

- Cache progress reporting to avoid blocking the clients
  (gh#agama-project/agama#2389).

- Update schema of the storage model (gh#agama-project/agama#2346).

- Provide software conflicts HTTP API (gh#agama-project/agama#2348)

- Cache issues to avoid blocking the clients
  (gh#agama-project/agama#2379).

- Cache the software configuration and products in the web server,
  the software backend is blocked during package installation
  (bsc#1241208)

- Add support for bridge connections (gh#agama-project/agama#2258).

- Do not crash when network events do not contain "addresses",
  "nameserver
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request May 27, 2025
https://build.opensuse.org/request/show/1280475
by user IGonzalezSosa + anag_factory
- Version 15

- Handle reused MD RAIDs that are already included at the storage
  configuration (gh/agama-project/agama#2346).

- Allow to resolve in web UI software conflicts
  (gh#agama-project/agama#2348)

- Do not crash when navigating to a Wi-Fi network (bsc#1243415)

- Keep margin between sidebar and main content in all breakpoints
  (gh/agama-project/agama#2370).

- Rework the installer l10n settings (gh#agama-project/agama#2359):
  - Improve discoverability of language and keyboard layout settings.
  - Add contextual messages to help users differentiate between
    installer and product localization settings.
  - Add the ability to reuse installer settings for the product
    to install.
  - In local connections, keyboard layout change is now available
    directly from modal dialog
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.

6 participants