feat(extensions): implement cryptographic integrity verification for extension updates (#21772)

This commit is contained in:
Emily Hedlund
2026-03-16 15:01:52 -04:00
committed by GitHub
parent d43ec6c8f3
commit 05fda0cf01
18 changed files with 1271 additions and 103 deletions

View File

@@ -101,12 +101,13 @@ export const useExtensionUpdates = (
return !currentState || currentState === ExtensionUpdateState.UNKNOWN;
});
if (extensionsToCheck.length === 0) return;
// eslint-disable-next-line @typescript-eslint/no-floating-promises
checkForAllExtensionUpdates(
void checkForAllExtensionUpdates(
extensionsToCheck,
extensionManager,
dispatchExtensionStateUpdate,
);
).catch((e) => {
debugLogger.warn(getErrorMessage(e));
});
}, [
extensions,
extensionManager,
@@ -202,12 +203,18 @@ export const useExtensionUpdates = (
);
}
if (scheduledUpdate) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Promise.all(updatePromises).then((results) => {
const nonNullResults = results.filter((result) => result != null);
void Promise.allSettled(updatePromises).then((results) => {
const successfulUpdates = results
.filter(
(r): r is PromiseFulfilledResult<ExtensionUpdateInfo | undefined> =>
r.status === 'fulfilled',
)
.map((r) => r.value)
.filter((v): v is ExtensionUpdateInfo => v !== undefined);
scheduledUpdate.onCompleteCallbacks.forEach((callback) => {
try {
callback(nonNullResults);
callback(successfulUpdates);
} catch (e) {
debugLogger.warn(getErrorMessage(e));
}