Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
690a711
throw error for network errors that arent 404s
jvigliotta May 28, 2025
9c13666
debug
jvigliotta May 28, 2025
3a0b7b0
throw error when non 404, return something so legacy persistence inte…
jvigliotta May 29, 2025
13b10ff
return empty object to not trigger interceptor
jvigliotta May 29, 2025
559b2e5
mimic missiong object return
jvigliotta May 29, 2025
ba43a8e
revert base persistence provider changes as they are not necessary
jvigliotta May 29, 2025
e1ea5c2
changes in base are actually need when creating missing
jvigliotta May 29, 2025
89ac1c6
revert to see if there is a more logical way to do this
jvigliotta Jun 3, 2025
0c16c55
debug
jvigliotta Jun 3, 2025
497d8de
revert some things add back in error object to check in old persisten…
jvigliotta Jun 3, 2025
4c7bd15
add check for error object in old persistence interceptor if so, dont…
jvigliotta Jun 3, 2025
89929bb
only return error object for non 404 network errors
jvigliotta Jun 3, 2025
97189df
remove debug
jvigliotta Jun 4, 2025
b2cbbf4
add retry on network errors for get
jvigliotta Jun 4, 2025
3af93e1
revert retry logic
jvigliotta Jun 5, 2025
32a4024
quick debug to test
jvigliotta Jun 5, 2025
f549c35
add openmct error notif
jvigliotta Jun 5, 2025
1e20c9f
throw error from base persistence so mcws persistence provider can ha…
jvigliotta Jun 5, 2025
2c600bd
add the getNamespace call to the try catch so any errors from that ar…
jvigliotta Jun 5, 2025
4ed3c8c
use correct notification api
jvigliotta Jun 5, 2025
ee12839
remove debug
jvigliotta Jun 5, 2025
e3e7a0d
update error message
jvigliotta Jun 9, 2025
b082adb
remove clutter from notification message, correct wording
jvigliotta Jun 9, 2025
3793e3f
;
jvigliotta Jun 9, 2025
2b125b2
update comment
jvigliotta Jun 9, 2025
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
4 changes: 2 additions & 2 deletions src/persistence/BaseMCWSPersistenceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ export default class BaseMCWSPersistenceProvider {

return;
}
} else {
throw readError;
}
}

return;
}

/**
Expand Down
18 changes: 16 additions & 2 deletions src/persistence/MCWSPersistenceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ export default class MCWSPersistenceProvider extends BaseMCWSPersistenceProvider
options.signal = abortSignal;
}

const persistenceNamespace = await this.#getNamespace(namespace, options);

try {
const persistenceNamespace = await this.#getNamespace(namespace, options);
let result = await persistenceNamespace.opaqueFile(key).read();

result = await this.#fromPersistableModel(result, identifier);
Expand All @@ -29,6 +28,21 @@ export default class MCWSPersistenceProvider extends BaseMCWSPersistenceProvider
} catch (error) {
console.warn('MCWSPersistenceProvider:get', error);

// it's a network error, we don't want to create a new object
if (error.status !== 404) {
const userFolder = namespace.split(':')[0].split('-').pop();
this.openmct.notifications.error(
`Unable to open ${userFolder} folder. Close and open the folder to try again. If issue persists, check network connection and try again.`
);

return {
identifier,
type: 'unknown',
name: 'Error: ' + this.openmct.objects.makeKeyString(identifier),
networkError: true
};
}

return;
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/persistence/oldPersistenceFolderInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export default async function oldPersistenceFolderInterceptor(
let userId = 'system';
let namespaceDefinition;

// if the object is a network error object, we don't want to create a new object
if (object.networkError === true) {
return object;
}

if (
isUserNamespace(usersNamespace, userKeyRegex, identifier) &&
!identifier.namespace.includes('shared')
Expand Down