Fix wrong display of recently pushed notification#25812
Conversation
|
duplicated with #25795 |
|
It does sound like it solves a different issue. |
|
Have no enough time to test this PR, I will test it later. |
| }) | ||
| err := db.GetEngine(ctx). | ||
| Where("pusher_id=? AND is_deleted=?", userID, false). | ||
| Where("repo_id=? AND pusher_id=? AND is_deleted=?", repoID, userID, false). |
There was a problem hiding this comment.
The problem I see with this is the following:
Now, you won't be able to see this message in forks.
I've thought about the logic in the previous PR and thought it seems sensible.
While I can also see your problem, the question is now which of the two is better?
Or is there a third approach to still include forks, i.e. additionally storing a ForkedFromID or something like that?
There was a problem hiding this comment.
I think it's difficult to get all forked repositories. Maybe only the first level forked?
There was a problem hiding this comment.
I meant the other way round as it is a one-to-n relation: Each fork only has a single parent, so we can check for repoID = fork or parent.
|
#25795 not looks good to me. It is not good to detect branch by name, as we may have same branch names in different repos. Added some screenshots to the pr description. |
|
We can add a test for this new feature later. |
go-gitea/gitea#25812 (comment) Follow #30573 (cherry picked from commit f7d2f695a4c57b245830a526e77fa62e99e00254) Conflicts: services/pull/check.go trivial conflict because 9b2536b78fdcd3cf444a2f54857d9871e153858f Update misspell to 0.5.1 and add `misspellings.csv` (#30573) was not cherry-picked
|
@wxiaoguang |
|
user13 is added as a collaborator to repo10, so access table changed. |
Why not just "append" one, and keep the old "id" as-is? |
@wxiaoguang |
|
So strange. I only saw 126 lines in compare_test.go, but the CI failed in L143. |
59b9311 to
8cea058
Compare
|
I was unable to create a backport for 1.22. @yp05327, please send one manually. 🍵 |


There's a bug in #25715:
If user pushed a commit into another repo with same branch name, the no-related repo will display the recently pushed notification incorrectly.
It is simple to fix this, we should match the repo id in the sql query.
The latest commit is 2 weeks ago.
The notification comes from another repo with same branch name:

After:




In forked repo:
New PR Link will redirect to the original repo:
In the original repo:
New PR Link:
In the same repo:


New PR Link:
08/15 Update:
Follow #26257, added permission check and logic fix mentioned in #26257 (comment)
2024/04/25 Update:
Fix #30611