-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
The Bug
Not completely sure, but Mappers.kt
JiraIssue#getOtherUpdateContext
might use the wrong update and transition objects:
arisa-kt/src/main/kotlin/io/github/mojira/arisa/infrastructure/jira/Mappers.kt
Lines 322 to 334 in e6c0902
private fun JiraIssue.getOtherUpdateContext( | |
jiraClient: JiraClient, | |
key: String | |
): Lazy<IssueUpdateContext> = | |
lazy { | |
IssueUpdateContextCache.get(key) ?: IssueUpdateContext( | |
jiraClient, | |
jiraClient.getIssue(key), | |
update(), | |
transition(), | |
transition() | |
).also { IssueUpdateContextCache.add(key, it) } | |
} |
Notice how the issue it uses for the IssueUpdateContext
is jiraClient.getIssue(key)
, but update()
and transition()
are from the (different) issue on which the extension function was invoked.
Expected behavior
update()
and transition()
should be called on the issue obtained from key
?
Might also be good to check whether this can be refactored to reuse JiraIssue.getUpdateContext()
(or add a common function for both) to prevent code duplication.