Skip to content

Commit

Permalink
Add equality keys to ExecutionOptionContext to ensure routing identit…
Browse files Browse the repository at this point in the history
…ies cross store routing correctly based on this exec ctx (#3036)
  • Loading branch information
gs-jp1 authored Aug 23, 2024
1 parent 42bc5a3 commit c28786c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function meta::pure::executionPlan::featureFlag::withFeatureFlags<T>(object:T[*

Class meta::pure::executionPlan::featureFlag::FeatureFlagOption extends meta::pure::executionPlan::ExecutionOption
{
flags:Enum[*];
<<equality.Key>> flags:Enum[*];
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function <<access.private>> meta::pure::executionPlan::collectionMultiExecutionC

Class meta::pure::executionPlan::ExecutionOptionContext extends MultiExecutionContext
{
executionOptions : ExecutionOption[*];
<<equality.Key>> executionOptions : ExecutionOption[*];
}

// Move to platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,14 @@ function <<test.Test>> meta::pure::executionPlan::tests::featureFlag::testContex
let context1= ^ExecutionOptionContext(executionOptions=^FeatureFlagOption(flags=meta::pure::executionPlan::tests::ExampleFlag.myFlag));
assert( $context1 ->contextHasFlag(meta::pure::executionPlan::tests::ExampleFlag.myFlag));

}
}

function <<test.Test>> meta::pure::executionPlan::tests::featureFlagOptionEquality(): Boolean[1]
{
let context1 = ^ExecutionOptionContext(executionOptions=^FeatureFlagOption(flags=meta::pure::executionPlan::tests::ExampleFlag.myFlag));
let context2 = ^ExecutionOptionContext(executionOptions=^FeatureFlagOption(flags=meta::pure::executionPlan::tests::ExampleFlag.myFlag));
let context3 = ^ExecutionOptionContext(executionOptions=^FeatureFlagOption());

assertEquals($context1, $context2);
assertNotEquals($context1, $context3);
}

0 comments on commit c28786c

Please sign in to comment.