Skip to content

fix(ui): detect out of sync storage#2622

Merged
joseivanlopez merged 19 commits intoagama-project:ui-syncfrom
joseivanlopez:storage-reload
Aug 6, 2025
Merged

fix(ui): detect out of sync storage#2622
joseivanlopez merged 19 commits intoagama-project:ui-syncfrom
joseivanlopez:storage-reload

Conversation

@joseivanlopez
Copy link
Copy Markdown
Contributor

@joseivanlopez joseivanlopez commented Jul 28, 2025

Problem

The storage UI does not automatically refresh when other clients perform changes (e.g., after loadig a config using the CLI). This happens to both the storage page and the storage section in the overview page.

Solution

Shows a blocking popup when there are storage changes performed by other clients. The user must click on reload in order to continue.

localhost_8080_ (28)

@joseivanlopez joseivanlopez changed the title fix(storage): refresh on changes fix(ui): refresh storage on changes Jul 28, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 28, 2025

Coverage Status

coverage: 53.685% (-0.08%) from 53.762%
when pulling de5b6a6 on joseivanlopez:storage-reload
into e2b949c on agama-project:ui-sync.

@joseivanlopez joseivanlopez force-pushed the storage-reload branch 6 times, most recently from 2c30afe to debe2cf Compare July 31, 2025 12:58
@joseivanlopez joseivanlopez changed the base branch from master to ui-sync July 31, 2025 12:58
- For example, when there are several attempts to calculate a valid
  proposal.
@joseivanlopez joseivanlopez force-pushed the storage-reload branch 3 times, most recently from 7e168cf to 8bb009d Compare July 31, 2025 16:17
@joseivanlopez joseivanlopez changed the title fix(ui): refresh storage on changes fix(ui): detect out of sync storage Jul 31, 2025
Comment thread web/src/components/core/AlertOutOfSync.tsx Outdated
@dgdavid

This comment was marked as resolved.

dgdavid added 2 commits August 3, 2025 19:50
Prevent errors when a device no longer exists, whether due to a mistyped
URL or changes in the underlying system.

It does so by introducing a new core component as a first step toward
unifying how Agama handles forms and pages that rely on URL parameters.
While this is an initial implementation, further refinement will be
needed as adoption grows and ergonomic improvements are identified to
make it fully adaptable and developer-friendly.
To show the out-of-sync alert when proceed.
joseivanlopez and others added 6 commits August 4, 2025 08:56
This reverts commit 2bbc686.
I.e., only if changes in storage were originated by an action of the
same client.

It also drops some dead code and an unwanted hasResult condition.
Using the StorageChanged signal and the clientId prop to determine if
the lasd changes are valid or not.
But still needing test since it is not fully working as expected.
@joseivanlopez joseivanlopez marked this pull request as ready for review August 5, 2025 11:33
Copy link
Copy Markdown
Contributor

@dgdavid dgdavid left a comment

Choose a reason for hiding this comment

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

Thanks @joseivanlopez

Web part LGTM despite the few minor comments I've left.

Comment thread web/src/components/core/AlertOutOfSync.tsx Outdated
Comment thread web/src/components/core/AlertOutOfSync.tsx Outdated
Comment thread web/src/components/core/AlertOutOfSync.tsx Outdated
Copy link
Copy Markdown
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

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

I see there is room to improve the behavior when you are at a form that stops making sense (eg. editing a partition that is not longer there in the new config).

But the current status is already much better than what we had before. So LGTM.

@joseivanlopez joseivanlopez merged commit 4c33466 into agama-project:ui-sync Aug 6, 2025
9 checks passed
joseivanlopez added a commit that referenced this pull request Aug 7, 2025
Merge feature branch into master. It includes:

* #2627
* #2630
* #2622
joseivanlopez added a commit that referenced this pull request Sep 16, 2025
## Problem

The storage config is not properly exported to JSON when the size is
configured to use the current size of the device, see
https://github.com/agama-project/agama/blob/master/doc/storage_proposal_from_profile.md#using-current.

As side effect, devices marked to be shrunk in the UI were actually
configured to shrink and grow at the same time. The proposal currently
fails with such a config.

The problem only affects to the proposal calculated using the UI and it
started to fail since this PR
#2622. Although the real
source of the problem (wrong exported JSON) has been always there.

## Solution

Generate the correct JSON when using the current size of a device.

## Testing

* Unit tests adapted
* Tested manually
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