MaintenancePoolService.assignReward reports a stale balance in its 'exceeds pool balance' error

Aperta
#608 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@urielit1313-creator ci sta già lavorando.

Dal 13/10/2026.

  • #624 di @urielit1313-creator — aperta
  • #650 di @yggdrasilworld — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Start in MaintenancePoolService.assignReward, at the error thrown when the conditional UPDATE ... WHERE balance >= :amount affects zero rows, and check where pool.balance was read before that update. Fix the message so it does not show a stale balance, either by re-reading the balance or using RETURNING, or by dropping the figure. Two open pull requests (#624 and #650) already target this issue, so compare them before writing a new patch. Done means the error reports a current or omitted balance under concurrent updates, with related issue #274 in mind.

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

Descrizione

bug good first issue

Problem

When the conditional UPDATE … WHERE balance >= :amount affects 0 rows, the error is Requested reward ${amount} exceeds pool balance ${pool.balance}. pool was read before the update, and under concurrency (exactly the case this guard exists for, #274) the balance shown can be higher than the real one. The message then says something like "exceeds pool balance 500" for a 300 reward.

Suggested fix

Re-read the balance (or RETURNING balance) for the message, or omit the figure.

Related: #274

Lingua principale
TypeScript
Stelle
2
Fork
90
Merge medio
31m
PR unite (30g)
20

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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 MergeFi/backend

Tutte le issue di MergeFi/backend

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.