#1662 Last update time is incorrectly being adjusted for pull-requests
Closed: Fixed Opened by mreynolds.

It appears that the last update time (used for the "Modified" field) is not being maintained correctly for pull-requests (Issues appear unaffected). Just viewing a pull-request causes it to be "modified".

So something is missing from:

https://pagure.io/pagure/issue/1549
https://pagure.io/pagure/pull-request/1561


Just viewing a pull-request causes it to be "modified".

That might actually be the case if the merge_status is refreshed.

This one https://pagure.io/pagure/pull-request/1661 says it was updated 15 minutes ago, so that would be correct.

This one https://pagure.io/pagure/pull-request/1661 says it was updated 15 minutes ago, so that would be correct.

It shows it was just modified 1 second ago ;)

hm, not it says 2 minutes ago for me :/

hm, not it says 2 minutes ago for me :/

Now it says 20 minutes - something odd is going on :(

And issues seems off too (but in a different way). I updated an issue but it shows that it was last updated 10 days

yeah, just this ticket says: last update 24 minutes ago while you just commented :(

I'll try and reproduce in my dev env...

This comment did update the modified time. DB issue?

The behaviour is definitely inconsistent with Issues. Could this be an issue/race condition with flushing DB updates verses committing them? ( I sent you an email about this too).

This is a major issue for us, as this definitely needs to be working correctly before we can migrate. :(

Yeah its even happening with new issues - I thought it might have been a problem with old issues, but apparently not. You can see this with a new issue I just filed: https://pagure.io/pagure/issue/1663

Using master branch(and going back to 2.10 rebase commit) in my dev environment works fine , so I don't know what going on. Still appears to be a DB issue to me.

Okay, so it appears the problem is that when adding new comments we don't set the last updated time (for anyone). If you are a repo admin, and add a new comment, the last update time get sets somewhere else (basically by accident). So the fix is just setting the last update time in add_issue comment(). I will open a pull_request for this.

There is still an issue with PR's, and simply viewing one (reload it twice) will somehow cause the last_updated time to get updated.

Duplicate issue: https://pagure.io/pagure/issue/1743

One idea:

The merge status of PRs is cached to reduce the load on the server, but when a PR is merged, we clear the cached merged status of all the open PRs as that status will obviously change. But this means we are updating the PR object in the database.

So merging one PR, updates all the open PRs, meaning, change the last_update field of all of them.

This might not be the only reason but would definitely explain a good part of it.

I don't know if this is related, but in the PR git checkout for koji there are a number of commits that only change the last_updated and updated_on values of a PR. This doesn't match up with incorrect displayed times, but still seems odd (or maybe I'm missing something).

when a PR is merged, we clear the cached merged status of all the open PRs

Ah yes, I think that change was in response to an issue I filed. I wondered if that might be related.

I believe this should be fixed by https://pagure.io/pagure/pull-request/1762

Appears so. Closing issue...

Metadata Update from @mreynolds:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @lslebodn:
- Issue tagged with: IDM

Metadata