mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
35480a3c7d
Record split-test state in Sentry metadata from web clients GitOrigin-RevId: 66dd195c546bd9fb0aedac52844200846c5012ca
22 lines
584 B
JavaScript
22 lines
584 B
JavaScript
const SplitTestHandler = require('./SplitTestHandler')
|
|
const logger = require('@overleaf/logger')
|
|
|
|
function loadAssignmentsInLocals(splitTestNames) {
|
|
return async function (req, res, next) {
|
|
try {
|
|
for (const splitTestName of splitTestNames) {
|
|
await SplitTestHandler.promises.getAssignment(req, res, splitTestName)
|
|
}
|
|
} catch (error) {
|
|
logger.error(
|
|
{ err: error, splitTestNames },
|
|
'Failed to load split test assignments in express locals in middleware'
|
|
)
|
|
}
|
|
next()
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
loadAssignmentsInLocals,
|
|
}
|