Merge pull request #18008 from overleaf/ab-fix-anon-assignment-append

[web] Fix anonymous assignment append to session

GitOrigin-RevId: 402cd94ec6250e15f0e35cb69af3977c78ec5a7d
This commit is contained in:
Alexandre Bourdin 2024-04-18 17:06:35 +02:00 committed by Copybot
parent cdf4f98c87
commit e4e054e8bb

View file

@ -84,8 +84,8 @@ async function appendAssignment(session, assignment) {
const assignments = await getAssignments(session)
if (
_.find(assignments[assignment.splitTestName], {
splitTestName: assignment.splitTestName,
!_.find(assignments[assignment.splitTestName], {
variantName: assignment.variantName,
versionNumber: assignment.versionNumber,
})
) {
@ -97,7 +97,12 @@ async function appendAssignment(session, assignment) {
// const assignmentString = _buildAssignmentString(splitTest, assignment)
// const separator = session.sta.length > 0 ? ';' : ''
// session.sta += `${separator}${assignmentString}`
session.splitTests[assignment.splitTestName].push(assignment)
session.splitTests[assignment.splitTestName].push({
variantName: assignment.variantName,
versionNumber: assignment.versionNumber,
phase: assignment.phase,
assignedAt: assignment.assignedAt,
})
}
}