Skip to content

fix: display error messages during installation#1909

Merged
imobachgs merged 6 commits intomasterfrom
fix-error-reporting
Jan 16, 2025
Merged

fix: display error messages during installation#1909
imobachgs merged 6 commits intomasterfrom
fix-error-reporting

Conversation

@imobachgs
Copy link
Contributor

@imobachgs imobachgs commented Jan 16, 2025

Problem

If something goes wrong during packages installation, Agama web UI does not show any message. We
found out that there are some problems:

  • When the connection goes down, TanStack Query will not perform any request (until the network is
    up).
  • The UI might loose the QuestionsChanged event if it is reconnecting the WebSocket at that point.

Solution

To overcome those problems, we have introduced the following changes:

  • Set TanStack Query network mode to "always" when running on localhost.
  • Invalidate questions query when the WebSocket is reconnected to make sure we do not miss any
    message.

Note

We could play with the refetchOnReconnect setting at global level. But let's be conservative at
this point.

Additional changes

agama-web-server:

  • Exit the WebSocket handler when the client is disconnected
  • Log the events

web UI:

  • refactor(web): expose onerror and onclose at WSClient level

Testing

  • Tested manually

Screenshots

Error message from libzypp

@imobachgs imobachgs marked this pull request as ready for review January 16, 2025 13:36
@imobachgs imobachgs merged commit 33324bd into master Jan 16, 2025
7 checks passed
@imobachgs imobachgs deleted the fix-error-reporting branch January 16, 2025 13:57
imobachgs added a commit that referenced this pull request Feb 6, 2025
## Problem

The web UI does not perform any mutation when the network gets
disconnected.

## Solution

Set the network mode to `always` for mutations, as they have a separate
set of default options from queries. This change is analogous to what we
did in #1909 for queries.

## Testing

- Tested manually
@imobachgs imobachgs mentioned this pull request Feb 26, 2025
imobachgs added a commit that referenced this pull request Feb 26, 2025
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.

2 participants