microsoft / microsoft/vscode-azureresourcegroups

`findTreeItem` fails for an app resource child contributed by a yet-to-be-activated extension

Open
#416 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛bug api
Dominant language
TypeScript
Stars
78
Forks
55
Avg merge
16h 49m
Merged PRs (30d)
139

Description

Databases will persist the connected database for each workspace. On activation, if the workspace has a connected database saved it does findTreeItem to get the tree item and then connects to it.

This specific use case of findTreeItem fails fairly consistently. Since the tree item we're looking for is a child of an application resource, when findTreeItem is executed, its success depends on if the tree has updated to use the newly registered Databases branch data provider to get the tree items (rather than the DefaultApplicationResourceBranchDataProvider). Since if the tree still has the tree items given by DefaultApplicationResourceBranchDataProvider, they won't have children.

Not sure what the best solution is to this. Should we have mechanisms in RGs to solve this? This could be a common scenario, basically anytime you try to do findTreeItem for a tree item that is contributed by a yet-to-be-activated extension.

Note: this repros about half the time for me. Depends on how fast the extension activates and the tree refreshes I guess.

Contributor guide

No contributing guide indexed for this repository

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 tracing findTreeItem with the DefaultApplicationResourceBranchDataProvider and the Databases branch data provider. Reproduce the saved-database activation flow while the extension and tree refresh occur at different speeds. Done means an application-resource child can be found reliably even when its contributing extension has not yet activated.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cloud, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.