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

umputun / feed-master / 35482677342
75%

Build:
DEFAULT BRANCH: master
Ran 20 Sep 2026 01:57AM UTC
Jobs 1
Files 16
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 Sep 2026 01:56AM UTC coverage: 74.721% (+0.09%) from 74.631%
35482677342

push

github

web-flow
fix: guard CleanText against a limit below the reserved suffix (#179)

`CleanText` sliced `[]rune(res)[:maximum-4]` with no lower bound on `maximum`, so any limit under 4 indexed negative and panicked.

it is reachable from remote feed content. `getMessageHTML` passes `CropText(description, 1024-len(header+footer))` at `app/proc/telegram.go:196`, and `header` is built from the feed item's own title and link:

```go
header = fmt.Sprintf("<a href=%q>%s</a>\n\n", item.Link, title)
```

neither is bounded anywhere, so a long enough title drives `maximum` below 4. `CropText` only checks `len([]rune(inp)) > maximum`, which a tiny or negative limit always satisfies, and forwards straight into `CleanText`.

a feed item with a 1000 character title and a five character description panics with `slice bounds out of range [:-47]`:

```
panic: runtime error: slice bounds out of range [:-47]
	app/proc/twitter.go:63
	app/proc/telegram.go:217
	app/proc/telegram.go:196
```

there is no `recover()` anywhere under `app/`, so one verbose or hostile feed item stops the daemon rather than failing a single notification.

the fix keeps the reserved-suffix branch for limits that can hold it. Below 4 there is no room for `" ..."`, so the text is truncated plainly, and a limit of zero or less returns empty.

`TestCleanText` only ever passed `max: 10`, which is why this stood. It now covers 3, 1, 0 and a negative, and `TestTruncatedMessageLongTitle` pins the path from a long title through `getMessageHTML`.

found by a revmux round on the v2.12 branch, reported as pre-existing rather than as part of that change.

Related to #174

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

1475 of 1974 relevant lines covered (74.72%)

10.72 hits per line

Jobs
ID Job ID Ran Files Coverage
1 35482677342.1 20 Sep 2026 01:57AM UTC 16
74.72
GitHub Action Run
Source Files on build 35482677342
  • Tree
  • List 16
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 03d30ca6 on github
  • Prev Build on master (#35482499508)
  • Next Build on master (#35483667476)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc