Summary
findBySubscriber in the subscriptions repository returns an unbounded result set, inconsistent with every other repository's list method in this codebase.
Location
backend/src/db/repositories/subscriptions.ts, function findBySubscriber: findMany({ where: { subscriber }, orderBy: {...} }) with no take
Problem
Every other repository method checked (auctions, bids, campaigns, impressions, publishers, governance) takes an explicit limit/take parameter. findBySubscriber doesn't — if a single subscriber ever accumulates many subscription records over time, this query returns all of them, unbounded.
Impact
Low-medium currently (subscription counts per user are likely small today), but a real resource-usage risk as the system grows, and a clear inconsistency with the rest of the codebase's established pattern.
Acceptance Criteria
Suggested Approach
Mirror whatever limit/pagination pattern an already-consistent repository (e.g. campaigns.ts or auctions.ts) uses.
Summary
findBySubscriberin the subscriptions repository returns an unbounded result set, inconsistent with every other repository's list method in this codebase.Location
backend/src/db/repositories/subscriptions.ts, functionfindBySubscriber:findMany({ where: { subscriber }, orderBy: {...} })with notakeProblem
Every other repository method checked (auctions, bids, campaigns, impressions, publishers, governance) takes an explicit
limit/takeparameter.findBySubscriberdoesn't — if a single subscriber ever accumulates many subscription records over time, this query returns all of them, unbounded.Impact
Low-medium currently (subscription counts per user are likely small today), but a real resource-usage risk as the system grows, and a clear inconsistency with the rest of the codebase's established pattern.
Acceptance Criteria
findBySubscribertakes an explicittake/limitparameter (with a sensible default and a cap), matching the pattern used elsewherefindBySubscriberare updated if their call signature needs to changenpm testpasses inbackend/Suggested Approach
Mirror whatever limit/pagination pattern an already-consistent repository (e.g.
campaigns.tsorauctions.ts) uses.