Run history: cap the window so fromDate=1970-01-01 cannot restore the unbounded read

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

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker-compose, java
Ambito
backend

Direzione di ricerca

Start from the scheduled transfers run history endpoint in consumer/ and the default twelve-month window added by #265, then follow where the fromDate parameter is parsed and passed to the Fineract run-history pagination loop (200 runs per page). Read #250 and #265 for the earlier unbounded-read context before touching anything. The first blocker is not code: a maintainer must choose between a maximum date window and a maximum page count, so ask on the issue which is preferred. Done looks like a documented limit, a rejection path for requests exceeding it, and endpoint tests covering fromDate=1970-01-01.

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

Descrizione

bug Triage
Where it happens

BFF API (consumer/)

What happened

#250 identified that the run history read can become increasingly expensive as the source account accumulates more scheduled transfer runs.

PR #265 introduced a default twelve-month date window, which addresses the unbounded default query.

However, callers can still explicitly provide fromDate=1970-01-01, effectively restoring the ability to read the entire run history.

The endpoint retrieves Fineract run history in pages of 200 runs. Since Fineract does not filter this history by instruction, the BFF may need to retrieve every run belonging to the source account within the requested date window.

This means the cost of the request can still grow with the account's history when a sufficiently large date range is supplied.

Expected behaviour:

  • Requests should have a maximum permitted date window or a maximum number of Fineract pages to retrieve.
  • Requests exceeding the permitted limit should receive a clearly defined response rather than triggering an effectively unbounded read.

Related:

  • #250
  • #265
  • #239

A maximum date window would be straightforward to document and test. Alternatively, a maximum Fineract page limit could bound upstream reads directly. The preferred approach should be agreed upon with maintainers.

Steps to reproduce
  1. Open the scheduled transfers run history endpoint.
  2. Make a request with fromDate=1970-01-01.
  3. Observe that the endpoint accepts the large date range.
  4. The BFF retrieves Fineract run history in pages of 200 runs.
  5. For accounts with extensive run history, this can result in a large number of upstream requests.

Expected: The endpoint should enforce a maximum date window or page limit.

Actual: An extremely large date range can still result in an effectively unbounded history read.

Error code, correlation ID and logs
Not applicable. This is a performance and resource-consumption concern rather than a failing BFF response. No specific error code or correlation ID is required to demonstrate the issue.
How you ran it

Docker Compose e2e stack (docker-compose.e2e.yml)

Fineract image

apache/fineract:405c18dcabfc235325e71616e816290234eead87

Commit

No response

Browser and version

No response

Before submitting
  • I searched the existing issues.
  • This is not a security vulnerability, and it is not a bug in Fineract Core.
Lingua principale
Java
Stelle
7
Fork
22
Merge medio
1g 14h
PR unite (30g)
50

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 apache/fineract-consumer-facing

Tutte le issue di apache/fineract-consumer-facing

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.