Skip to content

Commit a4a6c78

Browse files
authored
Don't join repository when loading action table data (#32127) (#32143)
backport #32127
1 parent 634454c commit a4a6c78

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

models/activities/action.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,7 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, int64, err
450450
return nil, 0, err
451451
}
452452

453-
sess := db.GetEngine(ctx).Where(cond).
454-
Select("`action`.*"). // this line will avoid select other joined table's columns
455-
Join("INNER", "repository", "`repository`.id = `action`.repo_id")
453+
sess := db.GetEngine(ctx).Where(cond)
456454

457455
opts.SetDefaultValues()
458456
sess = db.SetSessionPagination(sess, &opts)

models/activities/action_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ func TestNotifyWatchers(t *testing.T) {
226226
}
227227

228228
func TestGetFeedsCorrupted(t *testing.T) {
229+
// Now we will not check for corrupted data in the feeds
230+
// users should run doctor to fix their data
229231
assert.NoError(t, unittest.PrepareTestDatabase())
230232
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
231233
unittest.AssertExistsAndLoadBean(t, &activities_model.Action{
@@ -239,8 +241,8 @@ func TestGetFeedsCorrupted(t *testing.T) {
239241
IncludePrivate: true,
240242
})
241243
assert.NoError(t, err)
242-
assert.Len(t, actions, 0)
243-
assert.Equal(t, int64(0), count)
244+
assert.Len(t, actions, 1)
245+
assert.Equal(t, int64(1), count)
244246
}
245247

246248
func TestConsistencyUpdateAction(t *testing.T) {

0 commit comments

Comments
 (0)