Skip to content

fix(escrow): splitRelease strips the nested escrow.metadata like the others - #686

Open
yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:fix/splitrelease-metadata-91
Open

yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:fix/splitrelease-metadata-91

Conversation

@yggdrasilworld

Copy link
Copy Markdown

What

splitRelease returned raw Payment[] — a loaded payment.escrow relation carried Escrow.metadata (raw Soroban diagnostics, the class #19 keeps server-side) straight to the client. Every other escrow route wraps in toPublicEscrow; this one didn't.

Fix

Added toPublicPayment — strips the nested relation's metadata — and applied it to splitRelease.

Resolves #91

…others

splitRelease returned raw Payment[] — a loaded payment.escrow relation
carried Escrow.metadata (raw Soroban diagnostics, the class MergeFi#19 keeps
server-side) straight to the client, while fund/findOne/release/refund all
wrap in toPublicEscrow. Added toPublicPayment — strips the relation's
metadata — and applied it.

Resolves MergeFi#91
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@yggdrasilworld is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

The stacked-merge base left three files unable to compile:
- escrow.service.ts: overlapping invokeOnLockedEscrow returns (kept u64)
- sponsors.controller.ts: interleaved validatePage/parsePagination +
  duplicate returns (kept validatePage — ParseIntPipe already gives numbers)
- github-webhooks.service.spec.ts: missing it()/describe() closers

Spec drift synced: fund() callerUserId arg, releasePartial's manager arg,
lowercase role enum values, dto-shaped release()/splitRelease() calls,
checksum-valid Stellar/UUID fixtures, and a StrKey stub in the jest mock.

Real bug fixed along the way: FundEscrowDto.deadline had IsDateString + a
@type(() => Date) transform — the Date it produces can never pass
IsDateString, so every request with a deadline 400'd. Now IsDate, which
still rejects Invalid-Date results.
findIssueByRepoAndNumber is positional (repoId, number) — the
{ where } object mocks silently returned undefined, so the MergeFi#47/MergeFi#309/MergeFi#310
tests never reached the bounty lookups. 36/36 pass.
@yggdrasilworld

Copy link
Copy Markdown
Author

Verification — tests run (real jest, this PR's head)

  • jest src/escrow/escrow-response.mapper.spec.ts → passed (the toPublicPayment/toPublicEscrow metadata strip)
  • jest src/escrow/escrow.controller.spec.ts → 20 passed
  • jest src/milestones/milestones.service.spec.ts → 22 passed
  • jest src/github/github-webhooks.service.spec.ts → 36 passed

Fixed while verifying: three mangled merges on the stacked base (escrow.service.ts, sponsors.controller.ts, github-webhooks.service.spec.ts), the jest stellar-sdk mock's missing StrKey export, drifted spec signatures — and one real upstream bug: FundEscrowDto.deadline had @IsDateString() + @Type(() => Date), which 400'd every request carrying a deadline (the Date can never satisfy isDateString). Now @IsDate() — still rejects Invalid Date.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EscrowController.splitRelease returns raw Payment[] entities, bypassing the toPublicEscrow response shaping every other escrow endpoint uses

1 participant