Skip to content

feat(backend): reject partial payment gql api#3823

Merged
njlie merged 6 commits intofeature/encrypted-data-exchangefrom
nl/raf-1187/reject-partial-incoming-payment
Feb 13, 2026
Merged

feat(backend): reject partial payment gql api#3823
njlie merged 6 commits intofeature/encrypted-data-exchangefrom
nl/raf-1187/reject-partial-incoming-payment

Conversation

@njlie
Copy link
Copy Markdown
Contributor

@njlie njlie commented Feb 5, 2026

Changes proposed in this pull request

  • Adds the rejectPartialIncomingPayment graphql resolver.
  • Refactors shared code into separate method for (confirm/reject)PartialIncomingPayment.

Context

Fixes RAF-1187.

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Make sure that all checks pass
  • Bruno collection updated (if necessary)
  • Documentation issue created with user-docs label (if necessary)
  • OpenAPI specs updated (if necessary)

@njlie njlie requested review from mkurapov and sanducb February 5, 2026 17:51
@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. type: source Changes business logic pkg: mock-ase pkg: mock-account-service-lib labels Feb 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 5, 2026

🚀 Performance Test Results

Test Configuration:

  • VUs: 4
  • Duration: 1m0s

Test Metrics:

  • Requests/s: 44.67
  • Iterations/s: 14.90
  • Failed Requests: 0.00% (0 of 2687)
📜 Logs

> performance@1.0.0 run-tests:testenv /home/runner/work/rafiki/rafiki/test/performance
> ./scripts/run-tests.sh -e test "-k" "-q" "--vus" "4" "--duration" "1m"

Cloud Nine GraphQL API is up: http://localhost:3101/graphql
Cloud Nine Wallet Address is up: http://localhost:3100/
Happy Life Bank Address is up: http://localhost:4100/
cloud-nine-wallet-test-backend already set
cloud-nine-wallet-test-auth already set
happy-life-bank-test-backend already set
happy-life-bank-test-auth already set
     data_received..................: 970 kB 16 kB/s
     data_sent......................: 2.1 MB 34 kB/s
     http_req_blocked...............: avg=7.18µs   min=2.35µs   med=5.24µs   max=983.26µs p(90)=6.34µs   p(95)=6.86µs  
     http_req_connecting............: avg=943ns    min=0s       med=0s       max=852.3µs  p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=88.89ms  min=7.07ms   med=73.55ms  max=588.01ms p(90)=151.35ms p(95)=176.44ms
       { expected_response:true }...: avg=88.89ms  min=7.07ms   med=73.55ms  max=588.01ms p(90)=151.35ms p(95)=176.44ms
     http_req_failed................: 0.00%  ✓ 0         ✗ 2687
     http_req_receiving.............: avg=86.8µs   min=26.5µs   med=74.42µs  max=2.18ms   p(90)=113.18µs p(95)=144.43µs
     http_req_sending...............: avg=38.12µs  min=10.64µs  med=27.82µs  max=2.65ms   p(90)=40.15µs  p(95)=58.24µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=88.76ms  min=6.85ms   med=73.38ms  max=587.95ms p(90)=151.21ms p(95)=176.31ms
     http_reqs......................: 2687   44.670732/s
     iteration_duration.............: avg=268.22ms min=168.43ms med=254.57ms max=1.14s    p(90)=332.77ms p(95)=353.86ms
     iterations.....................: 896    14.895786/s
     vus............................: 4      min=4       max=4 
     vus_max........................: 4      min=4       max=4 

Base automatically changed from nl/raf-1186/confirm-partial-incoming-api to feature/encrypted-data-exchange February 6, 2026 19:15
@njlie njlie force-pushed the nl/raf-1187/reject-partial-incoming-payment branch from 237f759 to dd253b0 Compare February 6, 2026 22:43
Copy link
Copy Markdown
Contributor

@sanducb sanducb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, I only left a comment


const redis = await ctx.container.use('redis')
const cacheKey = `${PARTIAL_PAYMENT_DECISION_PREFIX}:${input.incomingPaymentId}:${input.partialIncomingPaymentId}`
const cacheKey = `kyc_decision:${input.incomingPaymentId}:${input.partialIncomingPaymentId}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial_payment_decision instead of kyc_decision here, to be consistent with confirmation resolver

throw new GraphQLError(
errorToMessage[IncomingPaymentError.UnknownPayment],
const redis = await ctx.container.use('redis')
const cacheKey = `${PARTIAL_PAYMENT_DECISION_PREFIX}:${input.incomingPaymentId}:${input.partialIncomingPaymentId}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have the business logic of the actual confirmation (and rejection) of the partial payment in the incomingPayment service. This is so the resolvers can be pretty thin and just know about how to call the service methods only.

(like in @sanducb 's PR > https://github.com/interledger/rafiki/pull/3706/changes#diff-afe36815c9819da35a080c01313ed35785086b4cb15eca035832d1785010f63a, where all of the decision awaiting process is happening in the incoming payment service)

Copy link
Copy Markdown
Contributor

@mkurapov mkurapov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment

@njlie njlie requested a review from mkurapov February 9, 2026 23:34
@njlie njlie merged commit e9b78da into feature/encrypted-data-exchange Feb 13, 2026
32 of 52 checks passed
@njlie njlie deleted the nl/raf-1187/reject-partial-incoming-payment branch February 13, 2026 18:06
sanducb pushed a commit that referenced this pull request Apr 7, 2026
* feat(backend): add confirmPartialIncomingPayment resolver

* feat: move return, revert jest env

* feat(backend): reject partial payment gql api

* fix: use correct redis key

* fix: use const

* feat: move redis call out of resolver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. pkg: mock-account-service-lib pkg: mock-ase type: source Changes business logic type: tests Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants