Merge pull request #8389 from overleaf/ab-fix-analytics-enabled-flag

Skip persisting assignment when analyticsEnabled is turned off

GitOrigin-RevId: e22b2cc29a5741ad90743ebaf5eb2c91cca0a2f5
This commit is contained in:
Alexandre Bourdin 2022-06-13 15:42:51 +02:00 committed by Copybot
parent a2532ef968
commit ad3eb0bfcc

View file

@ -192,10 +192,12 @@ async function _getAssignment(
phase,
versionNumber,
}
if (sync === true) {
await _updateVariantAssignment(assignmentConfig)
} else {
_updateVariantAssignment(assignmentConfig)
if (currentVersion.analyticsEnabled) {
if (sync === true) {
await _updateVariantAssignment(assignmentConfig)
} else {
_updateVariantAssignment(assignmentConfig)
}
}
return _makeAssignment(splitTest, selectedVariantName, currentVersion)
}