-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix duplicate issues in default boards #27659
Conversation
cc4d8c3
to
e109607
Compare
e109607
to
05a6c86
Compare
models/issues/issue_project.go
Outdated
@@ -51,7 +51,7 @@ func (issue *Issue) ProjectBoardID(ctx context.Context) int64 { | |||
func LoadIssuesFromBoard(ctx context.Context, b *project_model.Board) (IssueList, error) { | |||
issueList := make(IssueList, 0, 10) | |||
|
|||
if b.ID != 0 { | |||
if b.ID != 0 && !(b.ID == -1 && b.Default) { |
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.
Use constant variable but -1 directly.
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.
I don't understand what you mean. Can you please clarify?
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.
What lunny means is you should use a variable instead of the constant.
I'd even go a step further, and the whole new check should be extracted into its own function.
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.
The code used -1 since the Kanban board was introduced in 2020. Maybe should do some refactor later.
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.
I can simplify the check to b.ID > 0
to cover all cases.
034ec3d
to
6a8fc29
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.
I doubt that it will fix the issue. The wrapper function already uses transactions, no need for transactions again.
and according to the user-provided screenshot, I think it's probably because of other functions. (Though haven't found out why yet)
User reported in go-gitea#27639 that the same issue appears twice on their board. This fixes the source of duplication. Fixes go-gitea#27639 Signed-off-by: David Edler <david.edler@canonical.com>
6a8fc29
to
c1afe0e
Compare
this pull has no diff anymore. looks like #27705 did address this also |
But the issue is not fixed. Change |
Maybe open another PR or send some changes. |
Looks like this PR is empty now. |
This PR seems dead. |
A user reported in #27639 that the same issue appears twice on their project board. This fixes one source of duplication.
Fixes #27639