• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / tg-spam / 24767742687
83%

Build:
DEFAULT BRANCH: master
Ran 22 Apr 2026 08:15AM UTC
Jobs 1
Files 35
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Apr 2026 08:13AM UTC coverage: 82.966% (+0.02%) from 82.948%
24767742687

push

github

web-flow
Add reaction spam detection (#395)

* add plan: reaction-spam-detection

* feat: add reactionDetector in lib/tgspam

* feat: integrate reactionDetector into Detector (CheckReaction method and config)

* feat: add CheckReaction to Detector interface and OnReaction to SpamFilter

* feat: add reaction routing and procReaction handler to listener

* feat: add CLI flags for reaction spam detection and wire into detector config

* feat: final verification, lint fixes, and README docs for reaction spam detection

* fix: address code review findings for reaction spam detection

- fix: skip reaction removal events (empty NewReaction) to avoid counting removals as spam
- fix: replace ReportBan (msgID=0) with plain text admin notification for reaction bans; the ban already happens immediately and there is no spam message to delete
- refactor: remove dead lastSeen field from reactionHistory, use now.Sub(h.firstSeen) directly
- refactor: remove nil receiver check from reactionDetector.check (CheckReaction already guards)
- test: add NewReaction field to existing procReaction tests to correctly simulate add events
- test: add reaction_removal_not_counted test case
- test: assert CheckReaction not called for approved users, assert it is called for non-approved users
- test: add details assertion to threshold reached tests in reaction_test.go and detector_test.go
- test: improve "threshold exceeded" sub-test to verify count beyond threshold
- docs: add Reaction Spam Detection section to CLAUDE.md
- docs: add approved-user exemption rationale and AllowedUpdates note to README.md

* fix: address code review findings for reaction spam detection

* fix: address code review findings for reaction spam detection

- change sync.RWMutex to sync.Mutex in reactionDetector (write lock only)
- guard newReactionDetector against zero window to prevent silent detection failure

* fix: address code review findings for reaction spam detection

* fix: address code review findings for r... (continued)

114 of 133 new or added lines in 6 files covered. (85.71%)

2 existing lines in 1 file now uncovered.

7106 of 8565 relevant lines covered (82.97%)

254.44 hits per line

Uncovered Changes

Lines Coverage ∆ File
8
52.94
-47.06% app/bot/bot.go
8
81.27
0.53% app/events/listener.go
3
60.39
-0.08% app/main.go

Coverage Regressions

Lines Coverage ∆ File
2
76.77
-2.02% lib/tgspam/plugin/watcher.go
Jobs
ID Job ID Ran Files Coverage
1 24767742687.1 22 Apr 2026 08:15AM UTC 35
82.97
GitHub Action Run
Source Files on build 24767742687
  • Tree
  • List 35
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 12484154 on github
  • Prev Build on master (#24625754234)
  • Next Build on master (#25030940684)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc