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

umputun / tg-spam / 19550305352 / 1
83%
master: 83%

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

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)

6406 of 7778 relevant lines covered (82.36%)

275.28 hits per line

Source Files on job 19550305352.1
  • Tree
  • List 31
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 19550305352
  • 4bc63d0f on github
  • Prev Job for on master (#19528601838.1)
  • Next Job for on master (#19903555991.1)
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