refactor(hopper): compose bridge image cleanup through the shared owner

The image and publisher cleanup retry built its composite and bound the
parts by hand; providerCleanupErrorFromFailures builds the same composite.
It names close_binary, the ProviderCleanupError default that the parts
and the previous composite used.

Refs #11859

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
gensokyo-devandgensokyo-dev authored and Ysopwnable committed 2026-11-21 19:34:01 +01:00
1 parent 2d360253dd
commit 3ba20f0eb8
2 files changed
+13 -17

No files matched your search

@@ -11,7 +11,7 @@
"src/domain/explicitSensitiveFailure.ts": 1,
"src/evm/EvmoleInterfaceProvider.ts": 3,
"src/gdb/GdbSessionManager.ts": 2,
"src/hopper/BridgeLauncher.ts": 3,
"src/hopper/BridgeLauncher.ts": 2,
"src/hopper/HopperAnalysisProfile.ts": 1,
"src/hopper/HopperImageCopy.ts": 1,
"src/ida/IdaSessionClient.ts": 1,
+12 -16
View File
@@ -12,6 +12,7 @@ import {
} from "./HopperErrors.js";
import { err, ok, type Result } from "../domain/result.js";
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
import { providerCleanupErrorFromFailures } from "../domain/analysisErrorCleanup.js";
import {
ArtifactReaderFailure,
artifactPrimaryCleanupLeases,
@@ -266,23 +267,18 @@ export class HopperApplicationLauncher implements BridgeLauncher {
}
if (failures.length === 0) return ok(null);
if (failures.length === 1) return err(failures[0]!);
const resources = [
...new Set(failures.flatMap((failure) => failure.cleanupResources)),
];
const failure = new ProviderCleanupError(
"hopper",
resources,
{
reason: failures.map((failure) => failure.message).join("; "),
},
{
cause: new AggregateError(
failures,
"Hopper image and publisher cleanup remain incomplete",
),
},
// Match the parts, which use ProviderCleanupError's default operation.
return err(
providerCleanupErrorFromFailures(
"hopper",
failures,
failures.map((failure) => failure.message).join("; "),
{
operation: "close_binary",
message: "Hopper image and publisher cleanup remain incomplete",
},
),
);
return err(failure.bindCleanupDependencies(failures));
}
async launch(