Skip to content

Fix #8074: Prevent infinite spinner when root object provider is missing #8104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions src/ui/layout/MctTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,15 @@ export default {
},
async mounted() {
this.initialize();
await this.loadRoot();
this.isLoading = false;
try {
await this.loadRoot();
} catch (error) {
console.error('Error loading root object:', error);
// Even if root loading fails, we should still clear the loading state
// and show the tree in an empty state rather than infinite spinner
} finally {
this.isLoading = false;
}

if (!this.isSelectorTree) {
await this.syncTreeOpenItems();
Expand Down Expand Up @@ -313,12 +320,28 @@ export default {
this.treeItems = [];
const root = await this.openmct.objects.get('ROOT');

if (!root.identifier) {
if (!root || !root.identifier) {
console.warn('Root object is missing or has no identifier. Tree will remain empty.');
return false;
}

// Check if this is a missing object created by the interceptor
if (this.openmct.objects.isMissing(root)) {
console.warn('Root object is missing. Tree will show the missing root object.');
// Create a tree item for the missing root so users can see what's wrong
this.treeItems = [this.buildTreeItem(root, [])];
return false;
}

// will need to listen for root composition changes as well
this.treeItems = await this.loadAndBuildTreeItemsFor(root.identifier, []);
try {
// will need to listen for root composition changes as well
this.treeItems = await this.loadAndBuildTreeItemsFor(root.identifier, []);
} catch (error) {
console.error('Error loading root composition:', error);
// If composition loading fails, still show the root object
this.treeItems = [this.buildTreeItem(root, [])];
return false;
}
},
treeItemAction(parentItem, type) {
if (type === 'close') {
Expand Down