2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FEATURE: no need to cap new and unread together anymore

- leave unread alone
- cap new at 500 per site, with a site setting
This commit is contained in:
Sam 2015-10-01 17:17:15 +10:00
parent 9bb7a3884b
commit 6f43b575a8
5 changed files with 2 additions and 38 deletions

View file

@ -41,8 +41,6 @@ describe TopicTrackingState do
it "correctly handles capping" do
$redis.del TopicUser.unread_cap_key
user = Fabricate(:user)
post1 = create_post
@ -67,20 +65,6 @@ describe TopicTrackingState do
report = TopicTrackingState.report(user.id)
expect(report.length).to eq(3)
SiteSetting.max_tracked_new_unread = 5
# business logic, we allow for 2/5th new .. 2/5th unread ... 1/5th buffer
TopicUser.cap_unread_backlog!
report = TopicTrackingState.report(user.id)
expect(report.length).to eq(3)
TopicUser.cap_unread_later(user.id)
TopicUser.cap_unread_backlog!
report = TopicTrackingState.report(user.id)
expect(report.length).to eq(2)
end
it "correctly gets the tracking state" do