Issue number will not be updated by closing an issue #5353

Closed
opened 2025-11-02 06:22:22 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @luwol03 on GitHub (May 5, 2020).

  • Gitea version (or commit ref): 99082eebd7
  • Git version: 2.20.1
  • Operating system: Linux Debian buster
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

If I automatically close issues via a reference in a pull request, the issue will be closed, but the number next to the issues tab will not be updated! Only if I restart gitea!
IMG_20200505_002924

Originally created by @luwol03 on GitHub (May 5, 2020). - Gitea version (or commit ref): 99082eebd76019fc608e44c4464da6398f51dccd - Git version: 2.20.1 - Operating system: Linux Debian buster - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description If I automatically close issues via a reference in a pull request, the issue will be closed, but the number next to the issues tab will not be updated! Only if I restart gitea! ![IMG_20200505_002924](https://user-images.githubusercontent.com/60048565/81119478-1e1ffd00-8f2b-11ea-8b38-a881d2066bfb.png)
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 06:22:22 -06:00
Author
Owner

@jolheiser commented on GitHub (May 5, 2020):

Are there any errors in the logs? I cannot reproduce this on try with the latest commit.

Admittedly try uses SQLite, so this could be specific to MySQL, but I'm not sure why that would be.

@jolheiser commented on GitHub (May 5, 2020): Are there any errors in the logs? I cannot reproduce this on try with the latest commit. Admittedly try uses SQLite, so this could be specific to MySQL, but I'm not sure why that would be.
Author
Owner

@luwol03 commented on GitHub (May 5, 2020):

Where I can find the log?

@luwol03 commented on GitHub (May 5, 2020): Where I can find the log?
Author
Owner

@jolheiser commented on GitHub (May 5, 2020):

Seems I spoke too soon.

Closing an issue from the PR description works, however when I closed the issue via a commit the number didn't change. (In both cases the issue closed, but in the latter it didn't update the number)
https://try.gitea.io/jolheiser/ciw/issues

@jolheiser commented on GitHub (May 5, 2020): Seems I spoke too soon. Closing an issue from the PR description works, however when I closed the issue via a _commit_ the number didn't change. (In both cases the issue closed, but in the latter it didn't update the number) https://try.gitea.io/jolheiser/ciw/issues
Author
Owner

@silverwind commented on GitHub (May 6, 2020):

Duplicate of https://github.com/go-gitea/gitea/issues/10536

@silverwind commented on GitHub (May 6, 2020): Duplicate of https://github.com/go-gitea/gitea/issues/10536
Author
Owner

@zeripath commented on GitHub (May 6, 2020):

So eventually when a commit is parsed that closes an issue we reach:

a1f11a05e9/modules/repofiles/action.go (L61-L149)

This calls

a1f11a05e9/modules/repofiles/action.go (L34-L49)

Which calls issue.ChangeStatus like all the other routes

@zeripath commented on GitHub (May 6, 2020): So eventually when a commit is parsed that closes an issue we reach: https://github.com/go-gitea/gitea/blob/a1f11a05e900f3d1130729b2095dbf1b3037658e/modules/repofiles/action.go#L61-L149 This calls https://github.com/go-gitea/gitea/blob/a1f11a05e900f3d1130729b2095dbf1b3037658e/modules/repofiles/action.go#L34-L49 Which calls `issue.ChangeStatus` like all the other routes
Author
Owner

@zeripath commented on GitHub (May 6, 2020):

issue.ChangeStatus calls issue.changeStatus which does call:

a1f11a05e9/models/issue.go (L622)

which attempts to update the row - but I suspect is not because the value is not being looked up from within the changed table.

The thing that all the other routes do is that they add a comment after the changestatus - not before - which will look at the committed changes to the issue table.

@zeripath commented on GitHub (May 6, 2020): `issue.ChangeStatus` calls `issue.changeStatus` which does call: https://github.com/go-gitea/gitea/blob/a1f11a05e900f3d1130729b2095dbf1b3037658e/models/issue.go#L622 which attempts to update the row - but I suspect is not because the value is not being looked up from within the changed table. The thing that all the other routes do is that they add a comment after the changestatus - not before - which will look at the committed changes to the issue table.
Author
Owner

@zeripath commented on GitHub (May 6, 2020):

The simplest solution is to move the createRefComment to after the attempt to close the issue.

This is also more correct as the comment should not be made until the issue is actually closed.

@zeripath commented on GitHub (May 6, 2020): The simplest solution is to move the createRefComment to after the attempt to close the issue. This is also more correct as the comment should not be made until the issue is actually closed.
Author
Owner

@stale[bot] commented on GitHub (Jul 5, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Jul 5, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@lunny commented on GitHub (Sep 18, 2020):

Close as duplicated, see #10536

@lunny commented on GitHub (Sep 18, 2020): Close as duplicated, see #10536
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5353