vaadin / vaadin/framework

Bug. TreeGrid collapsing/expanding functionallity freezes

Open
#10,104 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

Good day,

Met one issue with Treegrid component on Vaadin 8+ versions.

We leave in very dinamic world where data is changing very fast and we can't be sure that one query that returned one result will respond with same result after one second.

Problem is simple. If we impementing AbstractHierarchicalDataProvider and query inside hasChildren metrod returned positive number of elements and then when user clicked on arrow to expand this element and fetchChildren returned empty stream, then tree table collapsing/expanding functionallity will be freezed.

Solution to cache data on hasChildren call is inappropriate solution, because we should cache a lot of data in memory, and we are not sure, that even it will be used by customer. And data will not be up-to-date.

Possibly related ticket from different angle

I'm attached zip with demonstration of that issue.
TreeGridDemo.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the attached TreeGridDemo.zip and trace AbstractHierarchicalDataProvider behavior through hasChildren and fetchChildren. Reproduce the case where hasChildren reports children but fetchChildren returns an empty stream, then inspect the TreeGrid expansion and collapse handling. Done means the component remains usable after this data change and the scenario is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.