Cards' "stalled" metric is reset when reconsidered

Specifically, reconsidering removes the existing activity spike (if
one exists). This happens whether the card is reconsidered by entropy
or manually by a user.

ref: https://fizzy.37signals.com/5986089/collections/2/cards/916
This commit is contained in:
Mike Dalessio
2025-07-03 11:15:08 -04:00
parent 5cc5e26cb8
commit d376d7aa0c
2 changed files with 17 additions and 0 deletions
+16
View File
@@ -26,6 +26,22 @@ class Card::StallableTest < ActiveSupport::TestCase
assert_includes Card.stalled, cards(:logo)
end
test "a card with an old activity spike is not stalled after falling back to considering" do
card = cards(:logo)
card.engage
card.update!(last_active_at: 1.day.ago - card.collection.entropy_configuration.auto_reconsider_period)
card.create_activity_spike!(updated_at: 3.months.ago)
assert card.stalled?
assert_includes Card.stalled, card
assert_difference -> { Card.considering.count }, +1 do
Card.auto_reconsider_all_stagnated
end
assert_not card.reload.stalled?
end
# More fine-grained testing in Card::ActivitySpike::Detector
test "detect activity spikes" do
assert_not cards(:logo).stalled?