Skip to content

Conversation

@oana-lolea
Copy link
Contributor

Changes proposed in this pull request

  • CARD_SERVICE_URL is now optional
  • OpenPaymentsWalletAddress does not return cardServiceUrl if it's not set

Context

Fixes #3577
Linear #1113

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)

@github-actions github-actions bot added pkg: backend Changes in the backend package. type: source Changes business logic labels Aug 13, 2025
@oana-lolea oana-lolea requested review from mkurapov and njlie August 13, 2025 11:08
@github-actions
Copy link

github-actions bot commented Aug 13, 2025

🚀 Performance Test Results

Test Configuration:

  • VUs: 4
  • Duration: 1m0s

Test Metrics:

  • Requests/s: 43.97
  • Iterations/s: 14.66
  • Failed Requests: 0.00% (0 of 2642)
📜 Logs

> [email protected] 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..................: 954 kB 16 kB/s
     data_sent......................: 2.0 MB 34 kB/s
     http_req_blocked...............: avg=6.12µs   min=2.05µs   med=4.87µs   max=626.25µs p(90)=5.88µs   p(95)=6.35µs  
     http_req_connecting............: avg=572ns    min=0s       med=0s       max=582.01µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=90.37ms  min=6.47ms   med=76.97ms  max=597.81ms p(90)=150.48ms p(95)=171.05ms
       { expected_response:true }...: avg=90.37ms  min=6.47ms   med=76.97ms  max=597.81ms p(90)=150.48ms p(95)=171.05ms
     http_req_failed................: 0.00%  ✓ 0         ✗ 2642
     http_req_receiving.............: avg=88.34µs  min=24.6µs   med=73.55µs  max=3.93ms   p(90)=111.26µs p(95)=144.73µs
     http_req_sending...............: avg=34.67µs  min=8.98µs   med=27.04µs  max=1.93ms   p(90)=38.67µs  p(95)=53.08µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=90.25ms  min=6.35ms   med=76.88ms  max=597.72ms p(90)=150.41ms p(95)=170.95ms
     http_reqs......................: 2642   43.974209/s
     iteration_duration.............: avg=272.64ms min=169.26ms med=257.17ms max=1.17s    p(90)=326.22ms p(95)=362.69ms
     iterations.....................: 881    14.663618/s
     vus............................: 4      min=4       max=4 
     vus_max........................: 4      min=4       max=4 

@oana-lolea oana-lolea marked this pull request as ready for review August 13, 2025 11:25
axios: await deps.use('axios'),
logger: await deps.use('logger'),
cardServiceUrl: config.cardServiceUrl
if (config.cardServiceUrl) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this if and keep the cardService service defined, otherwise we might get unexpected behaviour if a singleton resolves to undefined.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can do a NoopCardService (similar to the NoopTelemetryService)

@github-actions github-actions bot added the pkg: frontend Changes in the frontend package. label Aug 14, 2025
@oana-lolea oana-lolea requested a review from mkurapov August 14, 2025 10:31
Copy link
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.

Looks good, for the last comment feel free to push it directly to pos-card-services

export async function createNoopCardService(): Promise<CardService> {
return {
async sendPaymentEvent(_eventDetails) {
// do nothing
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's have a warn log here.

@oana-lolea oana-lolea merged commit 9dbbcd8 into pos-card-services Aug 14, 2025
40 checks passed
@oana-lolea oana-lolea deleted the oana/raf-1134 branch August 14, 2025 17:22
njlie pushed a commit that referenced this pull request Aug 18, 2025
* Made CARD_SERVICE_URL optional

* Created cardService container only if cardServiceUrl is set in config

* Added noop card service when cardServiceUrl is not provided

* Regenerated graphql

* Added warning when CARD_SERVICE_URL is not set
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. type: source Changes business logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants