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

cameri / nostream / 45241960134
80%

Build:
DEFAULT BRANCH: main
Ran 23 Nov 2026 06:53PM UTC
Jobs 2
Files 346
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

23 Nov 2026 06:46PM UTC coverage: 79.812% (+0.006%) from 79.806%
45241960134

push

github

web-flow
fix(nip09): collect the ids of a deletion request in one pass (#1232)

## Description
`DeleteEventStrategy.execute` built the list of event ids to delete from
the `e` tags of a kind-5 event with

```ts
event.tags.reduce((eventIds, tag) => (isValidETag(tag) ? [...eventIds, tag[1]] : eventIds), [] as string[])
```

`[...eventIds, tag[1]]` copies everything collected so far for each tag,
so the work grows with the square of the number of `e` tags. The default
`limits.message.maxPayloadSize` is 512 KB, which holds about 7,000
`["e", "<64 hex>"]` tags (73 bytes each), and the loop runs
synchronously on the worker before any id is looked up and before the
event is stored. I timed the two forms in plain Node on 7,000 valid
tags: about 40 ms for the `reduce` with a spread, about 1 ms for one
pass. Any client that can get a kind-5 event accepted can make the
worker busy for that long per event, whether or not any of the
referenced events exist.

- the ids are collected in one pass into a `Set`, then passed on as an
array;
- an id that appears more than once is asked for once, in the order it
first appears. `deleteByPubkeyAndIds` uses a `WHERE ... IN`, so which
events are deleted does not change; it only stops a repeated id from
being sent 7,000 times;
- nothing else in the strategy changes.

## Related Issue
Partly addresses #1020 (finding F-038). That issue groups six findings;
this PR does F-038, so it does not close the issue.

## Motivation and Context
Work done for a message should grow with its size, not with the square
of it.

## How Has This Been Tested?

## Screenshots (if appropriate):

## Types of changes
- [ ] Non-functional change (docs, style, minor refactor)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

## Checklist:
- [x] My code follows the code style of this project.
- [ ] My cha... (continued)

5947 of 8068 branches covered (73.71%)

Branch coverage included in aggregate %.

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

12227 of 14703 relevant lines covered (83.16%)

656.4 hits per line

Jobs
ID Job ID Ran Files Coverage
1 Unit - 45241960134.1 23 Nov 2026 06:53PM UTC 346
77.76
GitHub Action Run
2 Integration - 45241960134.2 23 Nov 2026 06:53PM UTC 346
36.2
GitHub Action Run
Source Files on build 45241960134
  • Tree
  • List 346
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #45241960134
  • dcaba697 on github
  • Prev Build on main (#45241399966)
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