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

umputun / tg-spam / 19550305352
83%

Build:
DEFAULT BRANCH: master
Ran 20 Nov 2025 08:28PM UTC
Jobs 1
Files 31
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

20 Nov 2025 08:24PM UTC coverage: 82.361% (+0.3%) from 82.071%
19550305352

push

github

web-flow
fix: prevent message edits from triggering duplicate spam detection (#351)

* fix: prevent message edits from triggering duplicate spam detection

message edits were incorrectly counted as new duplicate messages, causing
users to be banned when editing messages multiple times. the fix checks if
a messageID already exists for a given hash before incrementing the
duplicate counter. edits now only update the lastSeen timestamp without
affecting the duplicate count.

- add isEdit detection by checking for existing messageID in tracker
- skip count increment and entry addition for message edits
- always update lastSeen timestamp (including edits)
- add test case reproducing the bug and verifying the fix

* refactor(duplicate): simplify architecture and fix edit detection bugs

**architectural improvements**:
- add messageID field to hashEntry struct
- entries[] now stores hash + time + messageID as single source of truth
- rebuild trackers (including messageIDs) directly from entries
- remove preserveMessageIDs function - no longer needed
- remove isMessageEdit helper - replaced with entry scanning

**bug fixes**:
- fix content-changing edit logic to find exact entry by messageID
  previously removed "first entry with hash" which could be wrong entry
  now scans filtered entries for specific entry.messageID match
- fix same-content edits re-triggering spam detection
  skip spam detection when isEdit=true to avoid false deletions
- fix edit detection when messageID trimmed from capped list
  detect edits by scanning filtered entries instead of tracker.messageIDs
  works even when ID evicted from messageIDs cap
- fix limitEntriesPerUser creating orphaned messageIDs
  remove messageIDs when trimming entries to keep synchronized

**memory management**:
- cap messageIDs at min(maxEntriesPerUser, 100)

**tests**:
- add TestDuplicateDetector_EditWithDifferentContent
- add TestDuplicateDetector_EditChangingContentDoesNotIncrementOldCount
- add TestDuplicateDetecto... (continued)

118 of 118 new or added lines in 1 file covered. (100.0%)

6406 of 7778 relevant lines covered (82.36%)

275.28 hits per line

Jobs
ID Job ID Ran Files Coverage
1 19550305352.1 20 Nov 2025 08:28PM UTC 31
82.36
GitHub Action Run
Source Files on build 19550305352
  • Tree
  • List 31
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 4bc63d0f on github
  • Prev Build on master (#19528601838)
  • Next Build on master (#19903555991)
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

© 2025 Coveralls, Inc