Merge pull request #6934 from overleaf/ab-sso-user-assignment

Fix assignment by user ID for SSO test

GitOrigin-RevId: a487bf45444507246899ea918ffe02ad67e514d4
This commit is contained in:
Timothée Alby 2022-03-01 10:14:58 +01:00 committed by Copybot
parent b2e93f7db7
commit 0edd4b7899

View file

@ -7,6 +7,7 @@ const _ = require('lodash')
const { callbackify } = require('util')
const SplitTestCache = require('./SplitTestCache')
const { SplitTest } = require('../../models/SplitTest')
const UserAnalyticsIdCache = require('../Analytics/UserAnalyticsIdCache')
const DEFAULT_VARIANT = 'default'
const ALPHA_PHASE = 'alpha'
@ -78,7 +79,8 @@ async function getAssignmentForUser(
splitTestName,
{ sync = false } = {}
) {
return _getAssignment(splitTestName, { userId, sync })
const analyticsId = await UserAnalyticsIdCache.get(userId)
return _getAssignment(splitTestName, { analyticsId, userId, sync })
}
/**