-
Notifications
You must be signed in to change notification settings - Fork 202
Fix #1715: ApplyService#applyProjectRequest should be (truly) idempotent #1717
Conversation
@@ -1071,6 +1075,9 @@ public boolean applyProject(Project project) { | |||
* Returns true if the ProjectRequest is created | |||
*/ | |||
public boolean applyProjectRequest(ProjectRequest entity) { | |||
// Check whether project creation attempted before | |||
if (projectsCreated.contains(getName(entity))) | |||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the method signature, I think the return value should be false if projectsCreated contains getName(entity)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Thanks 👍
bdd0b02
to
1d38fe6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a small change. We need curly brackets everywhere for clarity.
@@ -1071,6 +1075,9 @@ public boolean applyProject(Project project) { | |||
* Returns true if the ProjectRequest is created | |||
*/ | |||
public boolean applyProjectRequest(ProjectRequest entity) { | |||
// Check whether project creation attempted before | |||
if (projectsCreated.contains(getName(entity))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohanKanojia curly brackets, please!
1d38fe6
to
c861dca
Compare
Fix #1715