Skip to content
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

JiraIssue#getOtherUpdateContext might use wrong update and transition #729

Open
Marcono1234 opened this issue Jul 19, 2021 · 0 comments
Open
Labels
bug Something isn't working discussion needed

Comments

@Marcono1234
Copy link
Contributor

The Bug

Not completely sure, but Mappers.kt JiraIssue#getOtherUpdateContext might use the wrong update and transition objects:

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.

@Marcono1234 Marcono1234 added bug Something isn't working discussion needed labels Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion needed
Projects
None yet
Development

No branches or pull requests

1 participant