Bug or feature? ;) -1 issues in repo #696

Open
opened 2 months ago by jwildeboer · 13 comments

Not sure if bug or feature ;) In my repository https://codeberg.org/jwildeboer/jwildeboersource I have 3 closed issues and 1 open. Somehow that becomes -1 issues?

Screenshot attached.

Jan

Not sure if bug or feature ;) In my repository https://codeberg.org/jwildeboer/jwildeboersource I have 3 closed issues and 1 open. Somehow that becomes -1 issues? Screenshot attached. Jan
Collaborator

That means you're all done and can relax for a while. The remaining issues aren't that important. (jk)

That means you're all done and can relax for a while. The remaining issues aren't that important. (jk)
fnetX added the
bug
gitea-related
labels 2 months ago
Collaborator

We trained an AI on customer data to help you find priorities in life. Like every big platform, we know better than you what your issue's relevance is :)

We trained an AI on customer data to help you find priorities in life. Like every big platform, we know better than you what your issue's relevance is :)
Poster

I guess this means that this issue will sove itself automagically. That IS a feature ;)

I guess this means that this issue will sove itself automagically. That IS a feature ;)
Collaborator

I guess this means that this issue will sove itself automagically. That IS a feature ;)

This require some in-depth research into this. The open issues are generated via num_issues - num_closed_issue, so at some point there was a mismatch. @fnetX could you check if any other repository has issues - closed issues < 0? Maybe there's a pattern.

> I guess this means that this issue will sove itself automagically. That IS a feature ;) This require some in-depth research into this. The open issues are generated via `num_issues` - `num_closed_issue`, so at some point there was a mismatch. @fnetX could you check if any other repository has issues - closed issues < 0? Maybe there's a pattern.
Poster

I will leave issues in my repo untouched for a while in case you people need to have a deeper look. Though I do wonder what happens when I open a new issue. Will it be 0 or correct?

Just tell me when it is safe to try. Take your time in analysing this, I am in no hurry to add more issues right now.

Jan

I will leave issues in my repo untouched for a while in case you people need to have a deeper look. Though I do wonder what happens when I open a new issue. Will it be 0 or correct? Just tell me when it is safe to try. Take your time in analysing this, I am in no hurry to add more issues right now. Jan
Collaborator

I will leave issues in my repo untouched for a while in case you people need to have a deeper look. Though I do wonder what happens when I open a new issue.

Thank you for that.

Will it be 0 or correct?

It will then be zero, as num_issues in the database will be increased by one. Thus zeroing out the num_closed_issues.

Just tell me when it is safe to try. Take your time in analysing this, I am in no hurry to add more issues right now.

👍

> I will leave issues in my repo untouched for a while in case you people need to have a deeper look. Though I do wonder what happens when I open a new issue. Thank you for that. > Will it be 0 or correct? It will then be zero, as `num_issues` in the database will be increased by one. Thus zeroing out the `num_closed_issues`. > Just tell me when it is safe to try. Take your time in analysing this, I am in no hurry to add more issues right now. 👍

I guess it is a bug with deleted issues, issue 3 has been deleted, right?

jwildeboer/jwildeboersource#3

I guess it is a bug with deleted issues, issue 3 has been deleted, right? https://codeberg.org/jwildeboer/jwildeboersource/issues/3
Poster

Correct. I experimented with dependent issues, it didn't work teh way I wanted it to be so I deleted issue #3.

Correct. I experimented with dependent issues, it didn't work teh way I wanted it to be so I deleted issue #3.
Collaborator

Hmm weird, looking closer (with regard to deleting issues). It seems to be near impossible without a race condition happening that this is out-of-sync. The code responsible to update the fields is crystal clear: 9d6a2034bc/models/repo/repo.go (L764) and correct.

Hmm weird, looking closer (with regard to deleting issues). It seems to be near impossible without a race condition happening that this is out-of-sync. The code responsible to update the fields is crystal clear: https://github.com/go-gitea/gitea/blob/9d6a2034bcf0f62dadb51cfe1471632eaa52e36c/models/repo/repo.go#L764 and correct.
Poster

Ah yes, now that you say it! When I deleted that issue, I got no visual or other feedback from the page. So I may have clicked the delete button more than once. Agreed, possibly a rare combination of network lag and user with not a lot of patience ;)

So if adding a new issue makes the counters be in sync again that's good enough for me. Not really a bug, not really a feature.

Maybe add some cron job to check for these irregularites as a cheap "fix"?

Ah yes, now that you say it! When I deleted that issue, I got no visual or other feedback from the page. So I may have clicked the delete button more than once. Agreed, possibly a rare combination of network lag and user with not a lot of patience ;) So if adding a new issue makes the counters be in sync again that's good enough for me. Not really a bug, not really a feature. Maybe add some cron job to check for these irregularites as a cheap "fix"?
Collaborator

So if adding a new issue makes the counters be in sync again that's good enough for me. Not really a bug, not really a feature.

Don't think so, the database is out of sync. Either @ashimokawa or @fnetX would need to update the database (feel free to ping me on matrix to hop in a chat/call) to fix the issue.

Ah yes, now that you say it! When I deleted that issue, I got no visual or other feedback from the page. So I may have clicked the delete button more than once. Agreed, possibly a rare combination of network lag and user with not a lot of patience ;)

There's a common issue in Gitea that things might send twice or clicked twice without being noticed, it could be the case here.

Maybe add some cron job to check for these irregularites as a cheap "fix"?

There actually is... 9d6a2034bc/models/repo.go (L586) but seems like Gitea only covers num_closed_issues not the num_issues fields. Interesting.

> So if adding a new issue makes the counters be in sync again that's good enough for me. Not really a bug, not really a feature. Don't think so, the database is out of sync. Either @ashimokawa or @fnetX would need to update the database (feel free to ping me on matrix to hop in a chat/call) to fix the issue. > Ah yes, now that you say it! When I deleted that issue, I got no visual or other feedback from the page. So I may have clicked the delete button more than once. Agreed, possibly a rare combination of network lag and user with not a lot of patience ;) There's a common issue in Gitea that things might send twice or clicked twice without being noticed, it could be the case here. > Maybe add some cron job to check for these irregularites as a cheap "fix"? There actually is... https://github.com/go-gitea/gitea/blob/9d6a2034bcf0f62dadb51cfe1471632eaa52e36c/models/repo.go#L586 but seems like Gitea only covers `num_closed_issues` not the `num_issues` fields. Interesting.
Poster

Seems we have found a way to reproduce this issue reliably - hence I ask: Can I start working on my issues again? :)

Jan

Seems we have found a way to reproduce this issue reliably - hence I ask: Can I start working on my issues again? :) Jan

Now the number is -2
image

Now the number is -2 ![image](/attachments/b3064362-d7e0-439d-b977-7f3bc787765f)
108 KiB
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: Codeberg/Community#696
Loading…
There is no content yet.