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

cameri / nostream / 46051195700
80%

Build:
DEFAULT BRANCH: main
Ran 27 Nov 2026 06:44PM UTC
Jobs 2
Files 351
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

27 Nov 2026 06:40PM UTC coverage: 80.419% (+0.08%) from 80.338%
46051195700

push

github

web-flow
fix(import): collect the ids of a deletion request in one loop and cap them at 65,533 (#1269)

## Description

Two defects in the import path's handling of a kind `5` deletion
request, both in `src/services/event-import-service.ts`:

- The ids it names were collected with `[...ids, tag[1]]` for every
matching `e` tag, copying the whole list each time. That is quadratic: a
signed kind `5` with thousands of tags held the import before any id was
looked up.
- Nothing bounded the list. A request naming more than 65,533 distinct
ids exceeded PostgreSQL's 65,535 bind parameters, and the failure ended
the whole import.

The ids now come from one loop into a `Set`, so a repeated id is asked
for once and in the order it first appears — the shape
`src/handlers/event-strategies/delete-event-strategy.ts` already uses on
the live path. A kind `5` naming more than
`MAX_IMPORTED_DELETION_TARGETS` distinct ids is refused before anything
is deleted or stored: nothing it names is deleted, the request is not
stored, it counts as one line error, and the import goes on.

65,533 is derived rather than chosen. `deleteByPubkeyAndIds` binds the
pubkey, the excluded kind and the ids, so the statement carries two
bindings besides them; a repository test pins the total at exactly
65,535, so the constant cannot drift from the statement it bounds. `a`
tags are not counted, as the importer does not act on them, and a
non-deletion event with the same number of `e` tags is unaffected.

Peering sync writes through the same persister and gets the faster
collection without the cap: its frames are limited to 2 MiB
(`PEERING_MAX_PAYLOAD_BYTES`), about 28,000 ids, well under the limit.

Cherry-picked with `-x` from saket0187/nostream#1 (commit 55ada707),
which keeps the original author's history on the first commit. The
second commit takes the spec's boundary from the exported constant
instead of copying `65_533` into it.

## Related Issue

Closes #1254

## Motivation and Context

F-020 fr... (continued)

6293 of 8445 branches covered (74.52%)

Branch coverage included in aggregate %.

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

12706 of 15180 relevant lines covered (83.7%)

715.05 hits per line

Jobs
ID Job ID Ran Files Coverage
1 Integration - 46051195700.1 27 Nov 2026 06:44PM UTC 351
36.34
GitHub Action Run
2 Unit - 46051195700.2 27 Nov 2026 06:45PM UTC 351
78.43
GitHub Action Run
Source Files on build 46051195700
  • Tree
  • List 351
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #46051195700
  • 66484922 on github
  • Prev Build on main (#45990428360)
  • Next Build on main (#46055586263)
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