MatTreeFlattener does not preserve traversal order while flattening mixed [] and Observable<[]>
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
When `MatTreeFlattener` `flattenNodes` method is used to flatten a data structure that mixes use of `[]` and `Observable<[]>`, the resulting flattened nodes are out of order as the children found from `Observable<[]>` are not done syncronously, but instead are done in order of discovery as they are each sent into the microtask queue to be done. They are sent in the correct order however to the task queue.
It appears the code in question is here:
https://github.com/angular/material2/blob/da63c6f85005966b42864a6c10f60896c8362361/src/lib/tree/data-source/flat-data-source.ts#L62-L68
Contributor guide
Research direction
Start in src/lib/tree/data-source/flat-data-source.ts at the linked MatTreeFlattener.flattenNodes implementation, and reproduce flattening a structure that mixes [] with Observable<[]> children. Trace how those children are queued and verify that the flattened result preserves traversal order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100