Skip to content

fix: remove endless node retry from component directive (#10177) (CP: 25.2) - #10200

Merged
DiegoCardoso merged 1 commit into
25.2from
cherry-pick-10177-to-25.2-1790157065416
Sep 23, 2026
Merged

DiegoCardoso merged 1 commit into
25.2from
cherry-pick-10177-to-25.2-1790157065416

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This PR cherry-picks changes from the original PR #10177 to branch 25.2.

Original PR description

Description

Fixes #10145

The directive retried a failed node lookup forever. The retry came from #4920, a
workaround for #4919, where Flow sent a hidden grid's connector calls while holding back
the grid's nodes. Flow fixed that cause a month later in vaadin/flow#15885 by holding
back the JavaScript of an invisible component. A response's JavaScript runs after its
tree changes, so a node id that does not resolve now belongs to a component the server
has already discarded, and it never arrives.

Type of change

  • Bugfix

How to test

  1. Open HiddenGridComponentColumnPage.java (route vaadin-grid/hidden-grid-component-column)
  2. Run the counting snippet from the issue in the DevTools console; it prints 0
  3. Click Hide the grid, clear the items, hide the text column
  4. Run the snippet again; it prints 0, where it printed about 2 500 before this change
  5. Click Show the grid with new items; the component column shows component of item 2.1 and so on
  6. Click Hide the grid, Set new items and Show the grid in turn, twice; the component column shows the new items both times

[!NOTE]
The grid still renders stale rows when it is hidden while its items are replaced: Flow holds back the connector's JavaScript for an invisible grid but still sends a column's visible=false change. Those rows keep the content they had until the grid is shown again. This change removes the endless lookups they caused; the stale rendering needs a separate fix in Flow.

🤖 Generated with Claude Code

## Description

Fixes #10145

The directive retried a failed node lookup forever. The retry came from
#4920, a
workaround for #4919, where Flow sent a hidden grid's connector calls
while holding back
the grid's nodes. Flow fixed that cause a month later in
vaadin/flow#15885 by holding
back the JavaScript of an invisible component. A response's JavaScript
runs after its
tree changes, so a node id that does not resolve now belongs to a
component the server
has already discarded, and it never arrives.

- Removed the retry from `flow-component-directive.js`: a failed lookup
leaves the current cell content in place until the next render replaces
it
- Removed the `__nodeRetryTimeout` bookkeeping on the part's parent node
and the `disconnected` callback that only existed to clear it
- Replaced the web-test-runner tests that described the retry with tests
for the behavior that remains: the cell keeps the content it had when a
node is not in the registry, and a render with a new node id renders it
- Added `HiddenGridComponentColumnPage` and
`HiddenGridComponentColumnIT`, covering the #4919 case that had no
regression test and the recovery after the #10145 trigger

## Type of change

- Bugfix

## How to test

1. Open `HiddenGridComponentColumnPage.java` (route
`vaadin-grid/hidden-grid-component-column`)
2. Run the counting snippet from the issue in the DevTools console; it
prints `0`
3. Click **Hide the grid, clear the items, hide the text column**
4. Run the snippet again; it prints `0`, where it printed about 2 500
before this change
5. Click **Show the grid with new items**; the component column shows
`component of item 2.1` and so on
6. Click **Hide the grid**, **Set new items** and **Show the grid** in
turn, twice; the component column shows the new items both times

> [!NOTE]
> The grid still renders stale rows when it is hidden while its items
are replaced: Flow holds back the connector's JavaScript for an
invisible grid but still sends a column's `visible=false` change. Those
rows keep the content they had until the grid is shown again. This
change removes the endless lookups they caused; the stale rendering
needs a separate fix in Flow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DiegoCardoso
DiegoCardoso enabled auto-merge (squash) September 23, 2026 09:52
@sonarqubecloud

Copy link
Copy Markdown

@DiegoCardoso
DiegoCardoso merged commit 28b7b28 into 25.2 Sep 23, 2026
23 checks passed
@DiegoCardoso
DiegoCardoso deleted the cherry-pick-10177-to-25.2-1790157065416 branch September 23, 2026 10:01
@vaadin-bot

Copy link
Copy Markdown
Collaborator Author

This ticket/PR has been released with Vaadin 25.2.9.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants