diff --git a/src/maintenance-pool/maintenance-pool.service.ts b/src/maintenance-pool/maintenance-pool.service.ts index 13415a62..86ac588b 100644 --- a/src/maintenance-pool/maintenance-pool.service.ts +++ b/src/maintenance-pool/maintenance-pool.service.ts @@ -196,6 +196,10 @@ export class MaintenancePoolService { } async list(): Promise { - return this.poolRepo.find(); + // Load repository/sponsor/escrow — the frontend's adaptMaintenancePool + // needs them; a bare find() returned rows with no relations (#591). + return this.poolRepo.find({ + relations: ['repository', 'createdBy', 'escrow'], + }); } } diff --git a/src/milestones/milestones.service.ts b/src/milestones/milestones.service.ts index c2b7ee8b..f8f7d8ed 100644 --- a/src/milestones/milestones.service.ts +++ b/src/milestones/milestones.service.ts @@ -152,7 +152,14 @@ export class MilestonesService { `Milestone ${milestoneId} has not been funded yet`, ); } - assertTransition(milestone.status, MilestoneStatus.IN_PROGRESS); + // Only assert the transition when the milestone isn't already in-flight — + // the first resolution moves FUNDED -> IN_PROGRESS, so re-asserting on + // every resolveIssue made IN_PROGRESS->IN_PROGRESS fail and a milestone + // could only ever pay out its first issue (#578). An already-IN_PROGRESS + // milestone paying another issue needs no transition. + if (milestone.status !== MilestoneStatus.IN_PROGRESS) { + assertTransition(milestone.status, MilestoneStatus.IN_PROGRESS); + } // Verify the issue belongs to this milestone (#114). const issue = milestone.issues.find((i) => i.id === issueId); @@ -214,7 +221,12 @@ export class MilestonesService { } async list(): Promise { - return this.milestoneRepo.find(); + // Load the relations the frontend's adaptMilestone renders — repository + // (org/repo display), sponsor, escrow (fund status), issues (the linked + // issues). A bare find() returned empty rows (#591). + return this.milestoneRepo.find({ + relations: ['repository', 'sponsor', 'escrow', 'issues'], + }); } allocateBudget(id: string) {