Skip to content

Reject stale payment decisions at signed submission - #281

Merged
karagozemin merged 2 commits into
Fortexa-stellar:mainfrom
emirykl:drips/issue-258-abort-the-decision-build-submit-path-when-the-qu
Oct 1, 2026
Merged

karagozemin merged 2 commits into
Fortexa-stellar:mainfrom
emirykl:drips/issue-258-abort-the-decision-build-submit-path-when-the-qu

Conversation

@emirykl

@emirykl emirykl commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix quote expiry when a payment decision is allowed and carry it through build and submit.
  • Bind the built transaction to its decision ID and recheck the stored decision and expiry immediately before submission.
  • Cover valid, expired, and swapped-decision flows with mocked Horizon.

Test evidence

  • Focused Vitest suite: 54 passed; final end-to-end rerun: 5 passed.
  • git diff --check passed.
  • Repository-wide lint and type checks are limited by pre-existing syntax errors in src/lib/security/analyzer.ts and src/lib/auth/use-auth-session.ts; full lint also reports unrelated directive errors in src/lib/observability/metrics.test.ts.

Fixes #258

Verification

  • Focused Vitest suite: 54 passed; final end-to-end rerun: 5 passed. Horizon was mocked.
  • git diff --check: passed.
  • Repository-wide lint and type checks failed on pre-existing syntax errors in analyzer.ts and use-auth-session.ts. Focused ESLint passed before the final assertion and UI reset; its final rerun stalled.

Diagnostics

Recovered command failures: /bin/zsh -lc 'rg -n "quote|decision|auditEntry|expiry|expires|now|Date" src/lib/decision/engine.ts src/app/api/decision/route.ts src/app/api/stellar/build-payment/route.ts src/app/api/stellar/submit-signed/route.ts src/lib/validation/stellar* src/lib/storage/audit-store.ts src/components/decision-console.tsx' (1), /bin/zsh -lc 'npm test -- src/app/api/stellar/e2e-decision-build-submit.test.ts src/app/api/stellar/submit-signed-idempotency.test.ts src/app/api/stellar/submit-signed/route.test.ts src/app/api/stellar/build-payment/route.test.ts src/lib/stellar/verify-payment-quote.test.ts' (1), /bin/zsh -lc 'npx tsc --noEmit' (2), /bin/zsh -lc 'npm run lint' (1), /bin/zsh -lc 'npm test -- src/app/api/stellar/e2e-decision-build-submit.test.ts src/app/api/stellar/build-payment/route.test.ts src/app/api/stellar/submit-signed-idempotency.test.ts src/app/api/stellar/submit-signed/route.test.ts src/lib/stellar/verify-payment-quote.test.ts' (1), /bin/zsh -lc 'npx eslint src/app/api/decision/route.ts src/app/api/stellar/build-payment/route.ts src/app/api/stellar/build-payment/route.test.ts src/app/api/stellar/e2e-decision-build-submit.test.ts src/app/api/stellar/submit-signed-idempotency.test.ts src/app/api/stellar/submit-signed/route.ts src/app/api/stellar/submit-signed/route.test.ts src/components/decision-console.tsx src/lib/stellar/payment-build-authorization.ts src/lib/stellar/verify-payment-quote.ts src/lib/stellar/verify-payment-quote.test.ts src/lib/types/domain.ts src/lib/validation/schemas.ts' (130), /bin/zsh -lc 'git diff --check && git diff -- src/lib/types/domain.ts README.md' (2), /bin/zsh -lc 'npx eslint src/app/api/decision/route.ts src/app/api/stellar/build-payment/route.ts src/app/api/stellar/build-payment/route.test.ts src/app/api/stellar/e2e-decision-build-submit.test.ts src/app/api/stellar/submit-signed-idempotency.test.ts src/app/api/stellar/submit-signed/route.ts src/components/decision-console.tsx src/lib/stellar/payment-build-authorization.ts src/lib/stellar/verify-payment-quote.ts src/lib/stellar/verify-payment-quote.test.ts src/lib/types/domain.ts src/lib/validation/schemas.ts' (130), /bin/zsh -lc './node_modules/.bin/eslint src/lib/stellar/payment-build-authorization.ts src/lib/stellar/verify-payment-quote.ts src/app/api/stellar/e2e-decision-build-submit.test.ts src/app/api/stellar/submit-signed/route.ts' (130)

Pre-existing failures

These checks also fail on main without this change, so they are not caused by this PR: /bin/zsh -lc 'npx eslint src/app/api/decision/route.ts src/app/api/stellar/build-payment/route.ts src/app/api/stellar/build-payment/route.test.ts src/app/api/stellar/e2e-decision-build-submit.test.ts src/app/api/stellar/submit-signed-idempotency.test.ts src/app/api/stellar/submit-signed/route.ts src/components/decision-console.tsx src/lib/stellar/payment-build-authorization.ts src/lib/stellar/verify-payment-quote.ts src/lib/stellar/verify-payment-quote.test.ts src/lib/types/domain.ts src/lib/validation/schemas.ts', /bin/zsh -lc './node_modules/.bin/eslint src/lib/stellar/payment-build-authorization.ts src/lib/stellar/verify-payment-quote.ts src/app/api/stellar/e2e-decision-build-submit.test.ts src/app/api/stellar/submit-signed/route.ts'

@drips-wave

drips-wave Bot commented Sep 30, 2026

Copy link
Copy Markdown

@emirykl Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@karagozemin
karagozemin merged commit 8e04440 into Fortexa-stellar:main Oct 1, 2026
1 check failed
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.

Abort the decision-build-submit path when the quote expires between steps

2 participants