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

umputun / tg-spam / 28850477820
84%

Build:
DEFAULT BRANCH: master
Ran 07 Jul 2026 07:53AM 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

07 Jul 2026 07:51AM UTC coverage: 83.461% (-0.09%) from 83.554%
28850477820

push

github

umputun
fix: scope locator primary keys by gid to prevent cross-group clobbering

messages.hash and spam.user_id were single-column primary keys while the
upserts overwrite gid on conflict, so two instances with different
--instance-id sharing one database destroy each other's rows: the same text
(or a spam flag for the same user id) posted in group B clobbers group A's
row, silently breaking /spam reply-matching and the spam-info/unban buttons.

Keys are now composite: (gid, hash) and (gid, user_id). Existing databases
upgrade at startup inside the existing migration transaction - sqlite rebuilds
the tables (indexes recreated by InitTable right after), postgres swaps the PK
constraint in place. Both paths are idempotent; old data can't violate the new
keys since uniqueness on the single column implies uniqueness on the pair. The
gid columns are checked per table via catalog metadata, the spam gid backfill
goes through Adopt, and the postgres constraint name is quoted with
pq.QuoteIdentifier.

Tests: shared-DB isolation for both engines, postgres legacy-PK migration
(with nullable gid to exercise the implicit SET NOT NULL from ADD PRIMARY KEY),
partial-schema migration, and a full-row assertion on the sqlite rebuild copy.
The generic migration test now runs on postgres too via engine-aware helpers.
README documents that instances sharing one postgres database must upgrade
together.

128 of 177 new or added lines in 1 file covered. (72.32%)

2 existing lines in 2 files now uncovered.

8700 of 10424 relevant lines covered (83.46%)

251.01 hits per line

Uncovered Changes

Lines Coverage ∆ File
49
77.3
-1.41% app/storage/locator.go

Coverage Regressions

Lines Coverage ∆ File
1
77.3
-1.41% app/storage/locator.go
1
85.54
-0.1% app/webapi/webapi.go
Jobs
ID Job ID Ran Files Coverage
1 28850477820.1 07 Jul 2026 07:53AM UTC 41
83.46
GitHub Action Run
Source Files on build 28850477820
  • Tree
  • List 41
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 27bbe54f on github
  • Prev Build on master (#28848461549)
  • Next Build on master (#28850817269)
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