Skip to content

Conversation

@imobachgs
Copy link
Contributor

@imobachgs imobachgs commented Jun 13, 2025

Problem

Here is a proposal to solve bsc#1243276 and other synchronization problems. It needs to be tested more extensively.

We have detected that the web UI can get into the following scenario:

  1. The web UI tries to connect to the WebSocket.
  2. The web UI asks for the selected product. It caches the response.
  3. The product gets selected, for instance, loading a profile.
  4. The server emits the signal ProductSelected.
  5. The WebSocket connection is finally established.

As you can see, there is a chance that Agama misses the signal (step 4). If the WebSocket connections happens before (which is the normal case), everything should work.

Solution

  • Do not mount the App component until the WebSocket is ready.
  • If the connection is lost, App is umounted and it has the chance to clean-up the queries.

Tasks

  • Fix the tests.
  • Build an ISO to test the change. Testing images are here.

@coveralls
Copy link

Coverage Status

coverage: 88.496% (+26.1%) from 62.407%
when pulling 0ad1f49 on sync-queries
into 1495361 on master.

@coveralls
Copy link

coveralls commented Jun 16, 2025

Coverage Status

coverage: 64.894% (+2.4%) from 62.527%
when pulling b99adee on sync-queries
into 643e1c9 on master.

* It was failing most probably because of the suspend API.
* Just mock the hooks by now to workaround the problem.
* The installer context does not display the children unless the
  WebSocket is already connected.
dgdavid and others added 8 commits June 17, 2025 08:59
Because it is making the whole stack fail after latest changes with

> Uncaught ReferenceError: can't access lexical declaration
> '__WEBPACK_DEFAULT_EXPORT__' before initialization

Definetely, barrel files have proven to be kind of problematic when
application grow. For further reading on the pitfalls of barrel files,
see:

  https://tkdodo.eu/blog/please-stop-using-barrel-files
  https://laniewski.me/blog/pitfalls-of-barrel-files-in-javascript-modules/
@imobachgs imobachgs marked this pull request as ready for review June 17, 2025 13:06

// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: ["src/**/*.{js,jsx}", "!src/lib/*.js"],
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}"],
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

(bsc#1243276, gh#agama-project/agama#2479).
- Properly jump to the progress page when the product is selected
by a third party (e.g., "agama config load").
- Log WebSocket messages in the console with "debug" log level.
Copy link
Contributor

Choose a reason for hiding this comment

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

👌

@imobachgs imobachgs merged commit 35f31ba into master Jun 17, 2025
23 checks passed
@imobachgs imobachgs deleted the sync-queries branch June 17, 2025 13:59
@imobachgs imobachgs mentioned this pull request Jun 30, 2025
imobachgs added a commit that referenced this pull request Jun 30, 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.

4 participants