Skip to content

Commit

Permalink
fix: missing updates for current contributor fields when coordinating
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjei committed May 17, 2023
1 parent 2235d46 commit 88a730b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/backend/.default.env
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ GITHUB_MINIMUM_FOLLOWERS="1"
GITHUB_MINIMUM_FOLLOWING="5"
## Minimum amount of public repos for the GitHub account
GITHUB_MINIMUM_PUBLIC_REPOS="2"
## The access token used for rate limiting purposes
AUTH_GITHUB_ACCESS_TOKEN="YOUR-GITHUB-ACCESS-TOKEN"

# The email address of the user who is going to be the coordinator of all ceremonies.
# nb. right now, only one user could be a coordinator for all ceremonies deployed within the same instance.
Expand Down
8 changes: 7 additions & 1 deletion packages/backend/src/functions/circuit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const coordinate = async (
else if (participantIsNotCurrentContributor) {
printLog(`Coordinate - executing scenario B - single - participantIsNotCurrentContributor`, LogLevel.DEBUG)

newCurrentContributorId = currentContributor
newParticipantStatus = ParticipantStatus.WAITING
newContributors.push(participant.id)
}
Expand All @@ -148,6 +149,9 @@ const coordinate = async (
LogLevel.DEBUG
)

newParticipantStatus = ParticipantStatus.CONTRIBUTING
newContributionStep = ParticipantContributionStep.DOWNLOADING

// Remove from waiting queue of circuit X.
newContributors.shift()

Expand All @@ -164,7 +168,9 @@ const coordinate = async (

// Prepare update tx.
batch.update(newCurrentContributorDocument.ref, {
status: ParticipantStatus.WAITING, // need to be refreshed.
status: newParticipantStatus,
contributionStep: newContributionStep,
contributionStartedAt: getCurrentServerTimestampInMillis(),
lastUpdated: getCurrentServerTimestampInMillis()
})

Expand Down

0 comments on commit 88a730b

Please sign in to comment.