mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #13558 from overleaf/ab-group-sync-check-user-id-format
[web/cron] Check that the userId is a valid mongo ID GitOrigin-RevId: 0c5fce5c0e474ae9d8ad8683bccade2e0b74b0c7
This commit is contained in:
parent
2ef48be496
commit
ded4de3349
1 changed files with 5 additions and 0 deletions
|
@ -7,6 +7,7 @@ const {
|
|||
} = require('../../app/src/models/DeletedSubscription')
|
||||
const minimist = require('minimist')
|
||||
const _ = require('lodash')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
let FETCH_LIMIT, COMMIT, VERBOSE
|
||||
|
||||
|
@ -195,6 +196,10 @@ async function checkDeletedSubscriptionMemberships(
|
|||
}
|
||||
|
||||
async function sendCorrectiveEvent(userId, event, subscription) {
|
||||
if (!ObjectId.isValid(userId)) {
|
||||
console.warn(`Skipping '${event}' for user ${userId}: invalid user ID`)
|
||||
return
|
||||
}
|
||||
const segmentation = {
|
||||
groupId: subscription._id.toString(),
|
||||
subscriptionId: subscription.recurlySubscription_id,
|
||||
|
|
Loading…
Reference in a new issue