Skip to content

Conversation

@Artur-
Copy link
Member

@Artur- Artur- commented Jan 21, 2026

When a class breaks during development, Flow shows an error view. Previously, when the class was fixed and hotswapped, the error view remained visible because the hotswap system only refreshed views that used the changed class in their route chain.

This fix adds ErrorViewHotswapper plugin that detects when an error view is displayed (by checking if the current view implements HasErrorParameter) and triggers a browser refresh on any hotswap. The refresh re-navigates to the original URL, allowing the fixed code to be properly loaded.

When a class breaks during development, Flow shows an error view.
Previously, when the class was fixed and hotswapped, the error view
remained visible because the hotswap system only refreshed views that
used the changed class in their route chain.

This fix adds ErrorViewHotswapper plugin that detects when an error
view is displayed (by checking if the current view implements
HasErrorParameter) and triggers a browser refresh on any hotswap.
The refresh re-navigates to the original URL, allowing the fixed
code to be properly loaded.
@github-actions
Copy link

github-actions bot commented Jan 21, 2026

Test Results

1 326 files  + 1  1 326 suites  +1   1h 17m 59s ⏱️ + 1m 29s
9 401 tests + 2  9 333 ✅ + 2  68 💤 ±0  0 ❌ ±0 
9 855 runs  +32  9 779 ✅ +31  76 💤 +1  0 ❌ ±0 

Results for commit 47ec47d. ± Comparison against base commit 7514ffa.

♻️ This comment has been updated with latest results.

@github-actions github-actions bot added +0.0.1 and removed +1.0.0 labels Jan 22, 2026
Copy link
Collaborator

@mcollovati mcollovati left a comment

Choose a reason for hiding this comment

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

Looks good.
Could we add at least one test?

Adds unit tests to verify that ErrorViewHotswapper correctly:
- Triggers UI refresh when an error view is shown during hotswap
- Does not trigger refresh for normal views during hotswap
@sonarqubecloud
Copy link

@mcollovati mcollovati added target/24.9 target/25.0 Cherry-pick to 25.0 branch labels Jan 26, 2026
@mcollovati mcollovati merged commit ceb47c9 into main Jan 26, 2026
49 of 50 checks passed
@mcollovati mcollovati deleted the flow-hotswap-error-page branch January 26, 2026 13:32
@vaadin-bot
Copy link
Collaborator

Hi @Artur- and @mcollovati, when i performed cherry-pick to this commit to 25.0, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick ceb47c9
error: could not apply ceb47c9... fix: refresh error views automatically on hotswap (#23272)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot
Copy link
Collaborator

Hi @Artur- and @mcollovati, when i performed cherry-pick to this commit to 24.9, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick ceb47c9
error: could not apply ceb47c9... fix: refresh error views automatically on hotswap (#23272)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

mcollovati pushed a commit that referenced this pull request Jan 26, 2026
When a class breaks during development, Flow shows an error view.
Previously, when the class was fixed and hotswapped, the error view
remained visible because the hotswap system only refreshed views that
used the changed class in their route chain.

This fix adds ErrorViewHotswapper plugin that detects when an error
view is displayed (by checking if the current view implements
HasErrorParameter) and triggers a browser refresh on any hotswap.
The refresh re-navigates to the original URL, allowing the fixed
code to be properly loaded.

Adds unit tests to verify that ErrorViewHotswapper correctly:
- Triggers UI refresh when an error view is shown during hotswap
- Does not trigger refresh for normal views during hotswap
@mcollovati
Copy link
Collaborator

For simplicity, cherry pick to 24.9 will be done from the 25.0 PR

@vaadin-bot
Copy link
Collaborator

Hi @Artur- and @mcollovati, when i performed cherry-pick to this commit to 24.9, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick ceb47c9
error: could not apply ceb47c9... fix: refresh error views automatically on hotswap (#23272)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants