Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Webhook retries have no jitter, so failures synchronise

Aperta Adatta ai principianti
#341 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
80/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
nodejs, typescript
Ambito
backend

Direzione di ricerca

Inizia da src/alerts/delivery.ts, dove retryDelayMs calcola il backoff deterministico di 1 s/2 s/4 s e il ciclo dei tentativi lo richiama. Aggiungi il jitter completo dietro una sorgente di casualità iniettabile, mantenendo il limite massimo di tentativi esistente e la regola per cui le risposte 4xx non vengono ritentate. Esegui un singolo file vitest con npx vitest run src/tests/<file>.test.ts, usando la sorgente di casualità fissa per mostrare che due errori simultanei vengono ritentati in momenti diversi. È completato quando i ritardi hanno il jitter, il test passa in modo deterministico e il comportamento per i 4xx e per il limite di tentativi è invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:reliability difficulty:easy help wanted points:100 Stellar Wave
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

Lingua principale
TypeScript
Stelle
4
Fork
71
Merge medio
1g 15h
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Divinity-Labs/Lens

Tutte le issue di Divinity-Labs/Lens

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.