Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix user profile activity feed #1848

Merged
merged 2 commits into from
Jun 2, 2017
Merged

Conversation

ethantkoenig
Copy link
Member

Fixes #1202.

Causes the activity feed on a user's profile page to only be actions performed by that user. The activity feed on the dashboard is unchanged, and still shows relevant actions performed by other users.

@lunny lunny added the type/bug label Jun 1, 2017
@lunny lunny added this to the 1.2.0 milestone Jun 1, 2017
models/action.go Outdated
if err != nil {
return nil, fmt.Errorf("AccessibleReposEnv: %v", err)
}
repoIDs, err := env.RepoIDs(1, ctxUser.NumRepos)
repoIDs, err := env.RepoIDs(1, options.RequestedUser.NumRepos)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make two DB connection in a goroutine. Maybe sqlite will lock table.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a nice way to use the same connection in both places (i.e. the sess variable and this line). If you have a more specific suggestion about how to only make one connection, let me know.

For what it's worth, the first session (i.e. the sess variable) won't actually connect to the database until line 704, so I don't think the two connections will ever overlap.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change AccessibleReposEnv to add a new Engine field.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rearranged the code so that these calls take place before sess is even created.

@lunny
Copy link
Member

lunny commented Jun 1, 2017

Otherwise LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jun 1, 2017
@lunny
Copy link
Member

lunny commented Jun 1, 2017

LGTM

1 similar comment
@pgaskin
Copy link
Contributor

pgaskin commented Jun 1, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 1, 2017
@lunny lunny merged commit 4e5ee2b into go-gitea:master Jun 2, 2017
@ethantkoenig ethantkoenig deleted the fix/activity_feed branch June 2, 2017 01:56
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User's public activity isn't filtered by user
4 participants