diff --git a/packages/xo-server/src/xo-mixins/jobs/index.js b/packages/xo-server/src/xo-mixins/jobs/index.js index 9272bb9bf..8c81fb279 100644 --- a/packages/xo-server/src/xo-mixins/jobs/index.js +++ b/packages/xo-server/src/xo-mixins/jobs/index.js @@ -72,7 +72,16 @@ export type Executor = ({| const normalize = job => { Object.keys(job).forEach(key => { try { - job[key] = JSON.parse(job[key]) + const value = (job[key] = JSON.parse(job[key])) + + // userId are always strings, even if the value is numeric, which might to + // them being parsed as numbers. + // + // The issue has been introduced by + // 48b2297bc151df582160be7c1bf1e8ee160320b8. + if (key === 'userId' && typeof value === 'number') { + job[key] = String(value) + } } catch (_) {} }) return job