Skip to content

fix: task.memberId getting reset #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: logs
  • Loading branch information
rakibansary committed Sep 12, 2022
commit e610d8225f89cffe138daee932707840602b40d7
2 changes: 1 addition & 1 deletion src/services/ChallengeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ async function update (currentUser, challengeId, data, isFull) {
// the sync issue in the processor. However this is quick fix that works since winner.userId is task.memberId.
if (_.get(challenge, 'legacy.pureV5Task') && !_.isUndefined(data.winners)) {
const winnerMemberId = _.get(data.winners, '[0].userId')
logger.info(`Setting task.memberId to ${winnerMemberId} for challenge ${challengeId}. Task ${_.get(challenge, 'task')}`)
logger.info(`Setting task.memberId to ${winnerMemberId} for challenge ${challengeId}. Task ${_.get(data, 'task')} - ${_.get(challenge, 'task')}`)

if (winnerMemberId != null && _.get(data, 'task.memberId') !== winnerMemberId) {
logger.info(`Task ${challengeId} has a winner ${winnerMemberId}`)
Expand Down