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

umputun / tg-spam / 28681829406
84%

Build:
DEFAULT BRANCH: master
Ran 03 Jul 2026 08:27PM UTC
Jobs 1
Files 41
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

03 Jul 2026 08:22PM UTC coverage: 83.487% (+0.03%) from 83.458%
28681829406

push

github

web-flow
fix: data race on approvedUsers map in Detector.Check (#405)

* fix: guard approvedUsers map with dedicated mutex to prevent concurrent map writes

Detector.Check updates the approvedUsers map while holding d.lock as a read
lock only, so two concurrent Check calls on the approval path (FirstMessageOnly
is on by default) crash with a concurrent map write. The web /check API with
check_only:false is a live concurrent vector.

Add a leaf-level auLock guarding all approvedUsers access and a concurrency
regression test that fails under -race on the previous code.

* fix: cap approved count at approved level under concurrency

Concurrent first messages from the same user can all pass the pre-approved
check before any increment lands, pushing the count past FirstMessagesCount.
The short-msg-flood check subtracts the approved count from the total, so an
inflated count delays flood detection. Cap the increment under auLock and
cover with a same-user concurrency test. Flagged by codex review.

* fix: cap organic approved count at FirstMessagesCount

The previous cap of FirstMessagesCount+1 still let concurrent checks push the
count one above what sequential flow can produce; the +1 sentinel is reserved
for explicit AddApprovedUser and storage-loaded users. Add a deterministic cap
test using FirstMessageOnly=false where every ham message hits the increment.
Flagged by codex re-review.

31 of 33 new or added lines in 1 file covered. (93.94%)

8504 of 10186 relevant lines covered (83.49%)

252.11 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
94.15
-0.03% lib/tgspam/detector.go
Jobs
ID Job ID Ran Files Coverage
1 28681829406.1 03 Jul 2026 08:27PM UTC 41
83.49
GitHub Action Run
Source Files on build 28681829406
  • Tree
  • List 41
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 4d49a5dc on github
  • Prev Build on master (#28681521445)
  • Next Build on master (#28682305223)
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