Doubled feed in the dashboard and activity #1039

Closed
opened 2025-11-02 03:46:12 -06:00 by GiteaMirror · 30 comments
Owner

Originally created by @Albert221 on GitHub (Sep 3, 2017).

  • Gitea version (or commit ref): 1.2.0-rc1
  • Git version: 1.8.3.1
  • Operating system: CentOS 7
  • 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

I've got doubled the feed both in the dashboard and in the public activity. Almost everything is twice.

Screenshots

chrome_2017-09-03_15-04-23


screenshot-192 168 1 28-2017-09-03-15-07-45

Originally created by @Albert221 on GitHub (Sep 3, 2017). - Gitea version (or commit ref): 1.2.0-rc1 - Git version: 1.8.3.1 - Operating system: CentOS 7 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description I've got doubled the feed both in the dashboard and in the public activity. Almost everything is twice. ## Screenshots ![chrome_2017-09-03_15-04-23](https://user-images.githubusercontent.com/4085280/30003146-688cc684-90b9-11e7-9bfe-e155946016f1.png) --- ![screenshot-192 168 1 28-2017-09-03-15-07-45](https://user-images.githubusercontent.com/4085280/30003168-aaf3bd5c-90b9-11e7-8cd9-dea2ea778126.png)
GiteaMirror added the issue/duplicate label 2025-11-02 03:46:12 -06:00
Author
Owner

@lafriks commented on GitHub (Sep 3, 2017):

I think this is already fixed and fix will be in rc2

@lafriks commented on GitHub (Sep 3, 2017): I think this is already fixed and fix will be in rc2
Author
Owner

@Albert221 commented on GitHub (Sep 8, 2017):

I can confirm it's fixed :)

@Albert221 commented on GitHub (Sep 8, 2017): I can confirm it's fixed :)
Author
Owner

@jeppech commented on GitHub (Oct 20, 2017):

This still seems to be an issue. I am encountering it on v1.2.1. I cannot replicated on try.gitea.io though. It does not happen for new repositories created, after I've updated to 1.2.1, but actions on repos created prior to the upgrade, seems to be affected.

@jeppech commented on GitHub (Oct 20, 2017): This still seems to be an issue. I am encountering it on v1.2.1. I cannot replicated on try.gitea.io though. It does not happen for new repositories created, after I've updated to 1.2.1, but actions on repos created prior to the upgrade, seems to be affected.
Author
Owner

@jeppech commented on GitHub (Oct 20, 2017):

Some entries in the feed, are added 3 times, some 4 times. I cannot figure out why this is happening.

I'm unsure if this has anything to do with it. But I updated my Gitea instance from v1.1.3 to v1.2.1.

@jeppech commented on GitHub (Oct 20, 2017): Some entries in the feed, are added 3 times, some 4 times. I cannot figure out why this is happening. I'm unsure if this has anything to do with it. But I updated my Gitea instance from v1.1.3 to v1.2.1.
Author
Owner

@lunny commented on GitHub (Oct 20, 2017):

Maybe because duplicated hook scripts, you can rewrite hooks on admin panels if you have not customized them.

@lunny commented on GitHub (Oct 20, 2017): Maybe because duplicated hook scripts, you can rewrite hooks on admin panels if you have not customized them.
Author
Owner

@jeppech commented on GitHub (Oct 20, 2017):

@lunny do you mean this Resync pre-receive, update and post-receive hooks of all repositories.?

@jeppech commented on GitHub (Oct 20, 2017): @lunny do you mean this `Resync pre-receive, update and post-receive hooks of all repositories.`?
Author
Owner

@lunny commented on GitHub (Oct 20, 2017):

Yes.

@lunny commented on GitHub (Oct 20, 2017): Yes.
Author
Owner

@jeppech commented on GitHub (Oct 20, 2017):

That didn't help, unfortunately.

@jeppech commented on GitHub (Oct 20, 2017): That didn't help, unfortunately.
Author
Owner

@jeppech commented on GitHub (Oct 20, 2017):

Here's a snippet from the log, that also shows, the action being inserted 3 times

2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, 12, 1, 15, 1985, false, "", true, "189|", 1508504709}
2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 12, 1, 15, 1985, false, "", true, "189|", 1508504709}
2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 12, 1, 15, 1985, false, "", true, "189|", 1508504709}
@jeppech commented on GitHub (Oct 20, 2017): Here's a snippet from the log, that also shows, the action being inserted 3 times ``` 2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, 12, 1, 15, 1985, false, "", true, "189|", 1508504709} 2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 12, 1, 15, 1985, false, "", true, "189|", 1508504709} 2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 12, 1, 15, 1985, false, "", true, "189|", 1508504709} ```
Author
Owner

@lafriks commented on GitHub (Oct 20, 2017):

@jeppech check in repository settings that you don't have gitea git hook also in custom git-hook

@lafriks commented on GitHub (Oct 20, 2017): @jeppech check in repository settings that you don't have gitea git hook also in custom git-hook
Author
Owner

@jeppech commented on GitHub (Oct 21, 2017):

I've deleted the custom hook, that I've been using for automating builds with Jenkins. The hook folders,pre-receive, update and post-receive, only contain one hook file, which is the default Gitea hook that looks like the following:

$ cat update.d/gitea
#!/usr/bin/env bash
"/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3
@jeppech commented on GitHub (Oct 21, 2017): I've deleted the custom hook, that I've been using for automating builds with Jenkins. The hook folders,`pre-receive`, `update` and `post-receive`, only contain one hook file, which is the default Gitea hook that looks like the following: ``` $ cat update.d/gitea #!/usr/bin/env bash "/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3 ```
Author
Owner

@jeppech commented on GitHub (Oct 23, 2017):

Newly created repositories, on my Gitea instance, has the same default hooks (no duplicates or anything), as repositories created prior to v1.2.1.

@lafriks These are the available hooks, under Settings -> Git Hooks. No custom hooks have been added either.

@jeppech commented on GitHub (Oct 23, 2017): Newly created repositories, on my Gitea instance, has the same default hooks (no duplicates or anything), as repositories created prior to v1.2.1. @lafriks [These](https://jeppe.ch/i/1508749435.png) are the available hooks, under Settings -> Git Hooks. No custom hooks have been added either.
Author
Owner

@lunny commented on GitHub (Oct 23, 2017):

@jeppech could you ls update.d/ to see if there are other hook files there.

@lunny commented on GitHub (Oct 23, 2017): @jeppech could you `ls update.d/` to see if there are other hook files there.
Author
Owner

@jeppech commented on GitHub (Oct 23, 2017):

@lunny here you go

Repository prior to v1.2.1

$ ls update.d
gitea

$ cat update.d/*
#!/usr/bin/env bash
"/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3

Repository created on v1.2.1

$ ls update.d
gitea

$ cat update.d/*
#!/usr/bin/env bash
"/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3
@jeppech commented on GitHub (Oct 23, 2017): @lunny here you go Repository prior to v1.2.1 ``` $ ls update.d gitea $ cat update.d/* #!/usr/bin/env bash "/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3 ``` Repository created on v1.2.1 ``` $ ls update.d gitea $ cat update.d/* #!/usr/bin/env bash "/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3 ```
Author
Owner

@jeppech commented on GitHub (Nov 3, 2017):

Does any of you, got other suggestions, for fixing this?

@jeppech commented on GitHub (Nov 3, 2017): Does any of you, got other suggestions, for fixing this?
Author
Owner

@lunny commented on GitHub (Nov 3, 2017):

@jeppech I can't reproduce that.

@lunny commented on GitHub (Nov 3, 2017): @jeppech I can't reproduce that.
Author
Owner

@jeppech commented on GitHub (Nov 6, 2017):

Can you point me in any other direction? Is it only the hooks, that can cause this to happen? Is there some settings, I could try and reset?

@jeppech commented on GitHub (Nov 6, 2017): Can you point me in any other direction? Is it only the hooks, that can cause this to happen? Is there some settings, I could try and reset?
Author
Owner

@jeppech commented on GitHub (Nov 16, 2017):

@lunny Could you tell me which piece of code, is responsible for inserting the activity in the database, and which part is triggering it. Then I'll try and tinker with it, my self.

@jeppech commented on GitHub (Nov 16, 2017): @lunny Could you tell me which piece of code, is responsible for inserting the activity in the database, and which part is triggering it. Then I'll try and tinker with it, my self.
Author
Owner

@jeppech commented on GitHub (Nov 22, 2017):

Something that catches my eye, when scrubbing through the xorm logs, is the user_id's being inserted.

2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, 12, 1, 15, 2256, false, "", true, "194|", 1511268140}
2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 12, 1, 15, 2256, false, "", true, "194|", 1511268140}
2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 12, 1, 15, 2256, false, "", true, "194|", 1511268140}

The user triggering the action, is me (id=1). But somehow the users with id 3 and 5.

Here's another snippet, triggered by another user, this time it has 4 entries. User with id 5, triggered the action, but 3,13,14 are also shown.

2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690}
2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{13, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690}
2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{14, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690}
2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690}
@jeppech commented on GitHub (Nov 22, 2017): Something that catches my eye, when scrubbing through the xorm logs, is the user_id's being inserted. ``` 2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, 12, 1, 15, 2256, false, "", true, "194|", 1511268140} 2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 12, 1, 15, 2256, false, "", true, "194|", 1511268140} 2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 12, 1, 15, 2256, false, "", true, "194|", 1511268140} ``` The user triggering the action, is me (id=1). But somehow the users with id 3 and 5. Here's another snippet, triggered by another user, this time it has 4 entries. User with id 5, triggered the action, but 3,13,14 are also shown. ``` 2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690} 2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{13, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690} 2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{14, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690} 2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690} ```
Author
Owner

@lunny commented on GitHub (Nov 22, 2017):

@jeppech everyone who watch the project will receive a message.

@lunny commented on GitHub (Nov 22, 2017): @jeppech everyone who watch the project will receive a message.
Author
Owner

@jeppech commented on GitHub (Nov 22, 2017):

@lunny It's just, that the numbers of insert statements, matches the number of duplicated items, in the activity feed. So I thought, that it might had something to do with, each other.

@jeppech commented on GitHub (Nov 22, 2017): @lunny It's just, that the numbers of insert statements, matches the number of duplicated items, in the activity feed. So I thought, that it might had something to do with, each other.
Author
Owner

@jeppech commented on GitHub (Nov 22, 2017):

Now, I just tried commenting on a repository, with 2 watchers, but i still see 3 entries being inserted into the actions, again, which corresponds to the number of duplicate items, in my feed.

Have there been any changes, to watchers, prior to v1.2.1, that could course the number of duplicate items in the feed to equal with the number of watchers?

@jeppech commented on GitHub (Nov 22, 2017): Now, I just tried commenting on a repository, with 2 watchers, but i still see 3 entries being inserted into the actions, again, which corresponds to the number of duplicate items, in my feed. Have there been any changes, to watchers, prior to v1.2.1, that could course the number of duplicate items in the feed to equal with the number of watchers?
Author
Owner

@lafriks commented on GitHub (Nov 22, 2017):

Actions seems to be inserted with different user IDs

@lafriks commented on GitHub (Nov 22, 2017): Actions seems to be inserted with different user IDs
Author
Owner

@jeppech commented on GitHub (Nov 28, 2017):

According to lunny, that is expected. As an entry is added, for each user watching the repo. What about the statement, that retrieves the feed?

2017/11/28 09:29:25 [I] [SQL] 
SELECT `id`, `user_id`, `op_type`, `act_user_id`, `repo_id`, `comment_id`, `is_deleted`, `ref_name`, `is_private`, `content`, `created_unix`
FROM `action`
WHERE (
	user_id=? OR repo_id IN (
		SELECT repo_id 
		FROM `access`
		WHERE access.user_id = ?
	)
)
AND is_deleted=?
ORDER BY `id`
DESC LIMIT 20
[]interface {}{1, 1, false}

Could this be getting different results, for repos created prior or after v1.2.1?

@jeppech commented on GitHub (Nov 28, 2017): According to lunny, that is expected. As an entry is added, for each user watching the repo. What about the statement, that retrieves the feed? ``` 2017/11/28 09:29:25 [I] [SQL] SELECT `id`, `user_id`, `op_type`, `act_user_id`, `repo_id`, `comment_id`, `is_deleted`, `ref_name`, `is_private`, `content`, `created_unix` FROM `action` WHERE ( user_id=? OR repo_id IN ( SELECT repo_id FROM `access` WHERE access.user_id = ? ) ) AND is_deleted=? ORDER BY `id` DESC LIMIT 20 []interface {}{1, 1, false} ``` Could this be getting different results, for repos created prior or after v1.2.1?
Author
Owner

@jeppech commented on GitHub (Dec 13, 2017):

I'm happy to say, that my issues are gone, as of v1.3.0! Thank you! :)

@jeppech commented on GitHub (Dec 13, 2017): I'm happy to say, that my issues are gone, as of v1.3.0! Thank you! :)
Author
Owner

@lunny commented on GitHub (Dec 13, 2017):

@jeppech how did you resolve that?

@lunny commented on GitHub (Dec 13, 2017): @jeppech how did you resolve that?
Author
Owner

@jeppech commented on GitHub (Dec 13, 2017):

To be honest, I have no idea. Just upgraded my Gitea instance 5 minutes ago, and all the doubled feeds are gone.

So I'm suspecting that either a query has changed, or some filtering in the templates. Haven't looked into it, so cannot say for sure.

@jeppech commented on GitHub (Dec 13, 2017): To be honest, I have no idea. Just upgraded my Gitea instance 5 minutes ago, and all the doubled feeds are gone. So I'm suspecting that either a query has changed, or some filtering in the templates. Haven't looked into it, so cannot say for sure.
Author
Owner

@lunny commented on GitHub (Dec 13, 2017):

And maybe you should upgrade to v1.3.1 since it fixed some bugs on v1.3.0.

@lunny commented on GitHub (Dec 13, 2017): And maybe you should upgrade to v1.3.1 since it fixed some bugs on v1.3.0.
Author
Owner

@jeppech commented on GitHub (Dec 13, 2017):

I already did that too, thanks! :)

@jeppech commented on GitHub (Dec 13, 2017): I already did that too, thanks! :)
Author
Owner

@davidlai-webstandard commented on GitHub (May 11, 2020):

I am seeing the same problem - but with the latest Gitea (1.11.5).

@davidlai-webstandard commented on GitHub (May 11, 2020): I am seeing the same problem - but with the latest Gitea (1.11.5).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1039