Webhook retries have no jitter, so failures synchronise
Maintainers usually reply within 1 day
@Richard-tobi is already working on this.
Since Oct 16, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nodejs, typescript
- Domain
- backend
Research direction
Start in src/alerts/delivery.ts, where retryDelayMs computes the deterministic 1s/2s/4s backoff and the retry loop calls it. Add full jitter behind an injectable randomness source, keeping the existing attempt cap and the rule that 4xx responses are not retried. Run a single vitest file with npx vitest run src/tests/<file>.test.ts, using the fixed random source to show two simultaneous failures retry at different times. Done when the delays are jittered, the test passes deterministically, and the 4xx and attempt-cap behaviour is unchanged.
Written by the indexing model from the issue text.
Description
Background
src/alerts/delivery.ts backs off deterministically:
function retryDelayMs(attempt: number): number {
return Math.pow(2, attempt - 1) * 1000
}
Every delivery that fails at the same moment retries at exactly the same moment
— 1s, then 2s, then 4s. A price movement is precisely the event that triggers
many alerts at once, so when a subscriber's endpoint has a wobble, Lens responds
by hitting it with a synchronised burst, three times, which is a good way to
turn a wobble into an outage.
What to build
- Add jitter. Full jitter — a random value between zero and the computed delay —
is the standard choice and is one line. - Keep the existing retry count and the existing rule that 4xx is not retried,
which is correct. - Make the test deterministic by injecting the randomness rather than asserting
on a range.
Acceptance criteria
- Retry delays are jittered
- Two deliveries failing simultaneously retry at different times, asserted by a test
- 4xx responses are still not retried
- The attempt cap is unchanged
- The randomness source is injectable so the test is not flaky
Drips Wave · Complexity: Easy · 100 points
Repo: Divinity-Labs/Lens. Node + TypeScript, Fastify, Prisma on Postgres,
Redis for queues, Prometheus via prom-client.
Run the tests: npm test. The tests are vitest, not jest. Running jest
against this repo reports "66 suites, 0 tests" and means nothing. A single file
is npx vitest run src/__tests__/yourfile.test.ts.
Load test (prices) is already failing on main and has been for some
time. It is not your PR that broke it. Every other check should be green.
This service prices real assets on Stellar mainnet. A number that is wrong
is worse than a number that is missing, because a caller cannot tell the
difference. Prefer failing loudly over returning a plausible value.
Never elide an address, a contract id or a key in code, a comment or a test
fixture. A previous batch wrote a shortened contract id in an issue text and
five contributors invented plausible-looking ids to fill the gap. Write the
whole thing or do not write it at all.
The house pattern for an outbound deadline already exists — see
src/alerts/delivery.ts, which passes signal: AbortSignal.timeout(10_000) to
fetch. Where an issue below asks for a timeout, copy that, do not invent a
second convention.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 71
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 34
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Divinity-Labs/Lens
-
The MCP server has no metricsPossibly taken @rupesh-kumar-sah claimed this today. Openarea:observability difficulty:easy help wanted points:100 Stellar Wave
Divinity-Labs/Lens#425 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Tool descriptions do not tell an agent when to stopPossibly taken @rupesh-kumar-sah claimed this today. Openarea:mcp difficulty:easy help wanted points:100 Stellar Wave
Divinity-Labs/Lens#424 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
No test drives a real 402 payment loopPossibly taken @Ugasutun claimed this today. Openarea:testing difficulty:advanced help wanted points:200 Stellar Wave
Divinity-Labs/Lens#423 · 6 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
The agent example is undocumentedPossibly taken @GazzyLee claimed this today. Openarea:docs difficulty:easy help wanted points:100 Stellar Wave
Divinity-Labs/Lens#422 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Only the error paths of one tool are testedPossibly taken @AGWAM001 claimed this today. Openarea:testing difficulty:intermediate help wanted points:150 Stellar Wave
Divinity-Labs/Lens#421 · 8 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in Divinity-Labs/Lens
Similar issues
-
area:security documentation effort:S priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
app:web meta:ops
Difficulty 2/5 Half a day Newbie friendliness 78/100
osu-tournament-rating/otr#1113 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
typegoose/mongodb-memory-server#1040 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 92/100