-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Conversation
142d061
to
8b1e87c
Compare
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Otherwise LGTM |
LGTM |
1 similar comment
LGTM |
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.