mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +00:00
fix(electron): retain selected scenario paths in evidence
This commit is contained in:
1 parent
68533bc0a3
commit
9222526fe2
6 files changed
+191
-54
No files matched your search
@@ -44,16 +44,30 @@ export const parseActiveElectronCapture = (
|
||||
z
|
||||
.object({
|
||||
application_path: absolutePathSchema,
|
||||
application_root: absolutePathSchema,
|
||||
application_root: absolutePathSchema.optional(),
|
||||
resolved_paths: z
|
||||
.strictObject({
|
||||
executable_path: absolutePathSchema,
|
||||
application_path: absolutePathSchema,
|
||||
application_root: absolutePathSchema,
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
.passthrough(),
|
||||
evidence.parameters,
|
||||
[...path, "parameters"],
|
||||
);
|
||||
// Older captures committed canonical paths directly in parameters. New
|
||||
// captures keep request spelling separate from the admitted execution paths.
|
||||
const executionPaths = parameters.resolved_paths ?? parameters;
|
||||
if (
|
||||
result.application.application_path !== parameters.application_path ||
|
||||
executionPaths.application_root === undefined ||
|
||||
result.application.application_path !== executionPaths.application_path ||
|
||||
(parameters.resolved_paths !== undefined &&
|
||||
result.application.executable_path !==
|
||||
parameters.resolved_paths.executable_path) ||
|
||||
!isPathWithinRoot(
|
||||
parameters.application_root,
|
||||
executionPaths.application_root,
|
||||
result.application.application_path,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user