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:
parent
9bb7a3884b
commit
6f43b575a8
5 changed files with 2 additions and 38 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue