-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
Hi @matthewelwell,
We encounter a huge production incident because we recently created an A/B test flag (without using it so far) because we didn't have the ext-gmp extension.
This because of the code
flagsmith-php-client/src/Engine/Features/FeatureStateModel.php
Lines 155 to 160 in f53cff2
| public function getValue($identityId = null) | |
| { | |
| if ($identityId && count($this->multivariate_feature_state_values) > 0) { | |
| return $this->getMultivariateValue($identityId); | |
| } | |
| return $this->_value; |
which, in case we enter in the
if partends up using
| public function getHashedPercentageForObjectIds(array $objectIds, int $iterations = 1) |
which use
gmp_init and gmp_strval (it also use bc_ methods).
I dunno if I should add them to the composer.json, because they are only needed if (and when) you are using the A/B testing flags.
- Adding them would avoid people having crash when using the A/B testing flags without the php extension
- But adding them would blocks people who use the lib without using the
multivariate_feature_state_valuesfeature if they don't have the extensions.
The other option would be for the lib to somehow skip such flags when the lib are not available and add a deprecation/php warning in logs...
I feel like updating the composer.json is simpler.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels