fix(runtime): preserve deterministic context identity
This commit is contained in:
@@ -26,7 +26,9 @@ export const commitBrowserScenarioNormalization = (
|
||||
...rule,
|
||||
artifacts: [...rule.artifacts].sort(),
|
||||
}))
|
||||
.sort((left, right) => left.rule_id.localeCompare(right.rule_id));
|
||||
.sort((left, right) =>
|
||||
left.rule_id < right.rule_id ? -1 : left.rule_id > right.rule_id ? 1 : 0,
|
||||
);
|
||||
const commitment = { built_in_rules: [...BUILT_IN_RULES], rules };
|
||||
return { ...commitment, sha256: digestCanonicalJson(commitment) };
|
||||
};
|
||||
|
||||
@@ -40,7 +40,8 @@ export const readinessFinding = (
|
||||
export const readinessFindingOrder = (
|
||||
left: ReadinessFinding,
|
||||
right: ReadinessFinding,
|
||||
): number =>
|
||||
`${left.stage_id}:${left.code}:${left.detail}`.localeCompare(
|
||||
`${right.stage_id}:${right.code}:${right.detail}`,
|
||||
);
|
||||
): number => {
|
||||
const leftKey = `${left.stage_id}:${left.code}:${left.detail}`;
|
||||
const rightKey = `${right.stage_id}:${right.code}:${right.detail}`;
|
||||
return leftKey < rightKey ? -1 : leftKey > rightKey ? 1 : 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user