File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
packages/libs/e2e-test-utils/src/lib/appManager Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -59,17 +59,19 @@ export async function registerNewAppVersion({
5959 existingAbilityMap . set ( ability . abilityIpfsCid , ability . policyIpfsCids ) ;
6060 } ) ;
6161
62- // Check if we have the same number of abilities
63- if ( existingAbilityMap . size !== abilityIpfsCids . length ) {
64- // Different number of abilities, need to register new version; fall through to register new version
65- } else {
62+ // Check if we have the same number of abilities and compare them
63+ if ( existingAbilityMap . size === abilityIpfsCids . length ) {
6664 // For each ability in the new version, check if it exists with the same policies
6765 const allMatch = abilityIpfsCids . every ( ( abilityId , index ) => {
6866 const existingPolicies = existingAbilityMap . get ( abilityId ) ;
69- if ( ! existingPolicies ) return false ; // Ability doesn't exist in current version
67+ if ( existingPolicies === undefined ) return false ; // Ability doesn't exist in current version
7068
7169 const newPolicies = abilityPolicies [ index ] ;
72- if ( ! newPolicies ) return false ; // Handle undefined policies
70+ if ( newPolicies === undefined ) {
71+ throw new Error (
72+ `Parallel arrays are not in sync: abilityPolicies[${ index } ] is undefined for ability '${ abilityId } '.` ,
73+ ) ;
74+ }
7375
7476 // Compare policy arrays (order-independent)
7577 if ( existingPolicies . length !== newPolicies . length ) return false ;
You can’t perform that action at this time.
0 commit comments