Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Closing a ticket before challenge is created #86

Closed
jmgasper opened this issue Sep 20, 2018 · 0 comments
Closed

Closing a ticket before challenge is created #86

jmgasper opened this issue Sep 20, 2018 · 0 comments

Comments

@jmgasper
Copy link
Collaborator

jmgasper commented Sep 20, 2018

Reported by a copilot:

I’ve this ticket topcoder-platform/community-app#1539 which was opened or pickup and fixed very fast and way before tcx creates a challenge for that…

Once I closed the ticket with the fix accepted label it stuck in a loop of trying to close a challenge that doesn’t exist in the db… I guess removing it from the db should fix the error, right?

From investigation:

@jmgasper I was looking at the processor code and the issue is quite clear..
You first create the Issue then you try to createChallenge and if something goes wrong you reschedule the event. Sounds good so far but it’s actually not. Inside the ensureChallengeExists method, you check if there’s already an Issue with status === "challenge_creation_pending" but since the Issue was created before the challenge creation failed, it stuck with the challenge_creation_pending status which means there’s actually no way a rescheduled even would work unless the Issue.create() also failed. Not a common situation... A simple fix would be to

await Issue.remove({
    number: issue.number,
    provider: issue.provider,
    repositoryId: issue.repositoryId
  })

inside the catch of the handleIssueCreate method.

jmgasper added a commit that referenced this issue Oct 2, 2018
#89 (major requirement)
#88 (major requirement)
#87 (major requirement)
#86 (major requirement)
#83
#82
#74
#71
#35 (major requirement)
#79 (major requirement)
#76
@jmgasper jmgasper closed this as completed Oct 4, 2018
jmgasper added a commit that referenced this issue Oct 9, 2019
#89 (major requirement)
#88 (major requirement)
#87 (major requirement)
#86 (major requirement)
#83
#82
#74
#71
#35 (major requirement)
#79 (major requirement)
#76
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant