From b9693fed201b1b30ce599edd90e5d169f68dc4c6 Mon Sep 17 00:00:00 2001 From: BIGMEECHXBT Date: Tue, 25 Aug 2026 19:36:41 +0100 Subject: [PATCH 1/8] fix: Optimize Prisma schema with composite indexes on heavily fil (#509) --- .../20260901000000_add_composite_indexes/migration.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 stellar-payment-platform/prisma/migrations/20260901000000_add_composite_indexes/migration.sql diff --git a/stellar-payment-platform/prisma/migrations/20260901000000_add_composite_indexes/migration.sql b/stellar-payment-platform/prisma/migrations/20260901000000_add_composite_indexes/migration.sql new file mode 100644 index 00000000..32ef94a0 --- /dev/null +++ b/stellar-payment-platform/prisma/migrations/20260901000000_add_composite_indexes/migration.sql @@ -0,0 +1 @@ +-- Add composite indexes for PaymentIntent and Transaction\n\nCREATE INDEX IF NOT EXISTS "payment_intents_status_created_at_idx" ON "payment_intents" ("status", "created_at");\nCREATE INDEX IF NOT EXISTS "payment_intents_from_status_idx" ON "payment_intents" ("from", "status");\nCREATE CREATE INDEX IF NOT EXISTS "payment_intents_to_status_idx" ON "payment_intents" ("to", "status");\n\nCREATE CREATE INDEX IF NOT EXISTS "transactions_status_created_at_idx" ON "transactions" ("status", "created_at");\nCREATE INDEX IF NOT EXISTS "transactions_from_status_idx" ON "transactions" ("from", "status");\nCREATE CREATE INDEX IF NOT EXISTS "transactions_to_status_idx" ON "transactions" ("to", "status");\n \ No newline at end of file From be7d94e0ef30e1fc30874bd8901f9ee28a4d8d0e Mon Sep 17 00:00:00 2001 From: BIGMEECHXBT Date: Tue, 25 Aug 2026 19:36:43 +0100 Subject: [PATCH 2/8] fix: Optimize Prisma schema with composite indexes on heavily fil (#509) --- stellar-payment-platform/prisma/schema.prisma | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stellar-payment-platform/prisma/schema.prisma b/stellar-payment-platform/prisma/schema.prisma index 6ccfe7d4..90f800e0 100644 --- a/stellar-payment-platform/prisma/schema.prisma +++ b/stellar-payment-platform/prisma/schema.prisma @@ -2,7 +2,7 @@ // Migrated from a raw SQLite database to PostgreSQL for higher concurrency. // // The DATABASE_URL is read from the environment (see .env.example): -// DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public" +// DATABASE_URL="postgresql://USER:PASSWORD@HOST:4CKESTORL/DATABASE?schema=public" datasource db { provider = "postgresql" @@ -22,9 +22,9 @@ model User { address String @unique memoType String? @map("memo_type") memo String? - createdAt DateTime @default(now()) @map("created_at") - flaggedAt DateTime? @map("flagged_at") - deletedAt DateTime? @map("deleted_at") + createdAt Datetime @default(now()) @map("created_at") + flaggedAt Datetime? @map("flagged_at") + deletedAt Datetime? @map("deleted_at") webhooks Webhook[] // <-- add this line @@index([username]) @@ -44,9 +44,9 @@ model Webhook { user User @relation(fields: [username], references: [username], onDelete: Cascade) url String secret String // HMAC-SHA256 signing secret for payload verification - createdAt DateTime @default(now()) @map("created_at") - lastSentAt DateTime? @map("last_sent_at") - failingSince DateTime? @map("failing_since") + createdAt Datetime @default(now()) @map("created_at") + lastSentAt Datetime? @map("last_sent_at") + failingSince Datetime? @map("failing_since") @@unique([username, url]) @@index([username]) @@ -67,9 +67,10 @@ model PaymentIntent { memoType String? @map("memo_type") memo String? status String @default("pending") - createdAt DateTime @default(now()) @map("created_at") + createdAt Datetime @default(now()) @map("created_at") @@index([to]) @@index([from]) + @@index([status, createdAt]) @@map("payment_intents") } From eab8af68d5284f4667fc1da64cba7024fcd5dacb Mon Sep 17 00:00:00 2001 From: BIGMEECHXBT Date: Tue, 1 Sep 2026 11:02:51 +0100 Subject: [PATCH 3/8] fix(ci): resolve failing checks for #576 --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cd4b71e..6fd4fe3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,6 @@ name: Production Safety Checks +name: Backend Unit Tests on: push: branches: [ "main" ] @@ -15,24 +16,23 @@ jobs: working-directory: ./stellar-payment-platform steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: '22' cache: 'npm' cache-dependency-path: ./stellar-payment-platform/package-lock.json - - name: Install Backend Dependencies - run: npm install + run: npm install --legacy-peer-deps - name: Run Backend Tests run: NODE_ENV=test npm test - name: Run Memory Leak Detection Tests (#511) - run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPathPattern=memory + run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPattern=memory env: MEMORY_TEST_REQUESTS: '200' MEMORY_LEAK_THRESHOLD_MB: '50' @@ -45,10 +45,10 @@ jobs: working-directory: ./payment-dashboard steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: '22' cache: 'npm' @@ -58,4 +58,4 @@ jobs: run: npm install --legacy-peer-deps - name: Verify Vite Build (Catches Vercel Crashes) - run: npm run build \ No newline at end of file + run: npm run build From d9b2b67e38b8b3e7c9bfc06c4db92ea9c1ce2825 Mon Sep 17 00:00:00 2001 From: BIGMEECHXBT Date: Tue, 1 Sep 2026 11:02:52 +0100 Subject: [PATCH 4/8] fix(ci): resolve failing checks for #576 --- .github/workflows/backend-tests.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 69a65af4..5d405cbc 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -11,16 +11,18 @@ jobs: strategy: matrix: - node-version: [20] + node-version: [22] steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: - node-version: ${{ matrix.node-version }} + node-version: $(( matrix.node-version )) + cache: 'npm' + cache-dependency-path: stellar-payment-platform/package-lock.json - name: Install backend dependencies working-directory: stellar-payment-platform @@ -31,7 +33,7 @@ jobs: - name: Run memory leak detection tests (#511) working-directory: stellar-payment-platform - run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPathPattern=memory + run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPattern=memory env: MEMORY_TEST_REQUESTS: '200' - MEMORY_LEAK_THRESHOLD_MB: '50' \ No newline at end of file + MEMORY_LEAK_THRESHOLD_MB: '50' From 02617c9a774c921ac6b0d9a1230e95d746483390 Mon Sep 17 00:00:00 2001 From: BIGMEECHXBT Date: Tue, 1 Sep 2026 11:05:46 +0100 Subject: [PATCH 5/8] fix(ci): resolve failing checks for #576 --- .github/workflows/backend-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 5d405cbc..0a67171d 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v5 with: - node-version: $(( matrix.node-version )) + node-version: $+{{ matrix.node-version }} cache: 'npm' cache-dependency-path: stellar-payment-platform/package-lock.json @@ -33,7 +33,7 @@ jobs: - name: Run memory leak detection tests (#511) working-directory: stellar-payment-platform - run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPattern=memory + run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPathPattern=memory env: MEMORY_TEST_REQUESTS: '200' MEMORY_LEAK_THRESHOLD_MB: '50' From 3358bd707a2473f96086470b85658f6eb94849ec Mon Sep 17 00:00:00 2001 From: BIGMEECHXBT Date: Tue, 1 Sep 2026 11:05:47 +0100 Subject: [PATCH 6/8] fix(ci): resolve failing checks for #576 --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fd4fe3e..5c6c6bb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,5 @@ name: Production Safety Checks -name: Backend Unit Tests on: push: branches: [ "main" ] @@ -32,7 +31,7 @@ jobs: run: NODE_ENV=test npm test - name: Run Memory Leak Detection Tests (#511) - run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPattern=memory + run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPathPattern=memory env: MEMORY_TEST_REQUESTS: '200' MEMORY_LEAK_THRESHOLD_MB: '50' From 8f93b8061ec34ef9e324cd4507c5ecf86afe48fe Mon Sep 17 00:00:00 2001 From: BIGMEECHXBT Date: Tue, 1 Sep 2026 11:11:29 +0100 Subject: [PATCH 7/8] fix(ci): resolve failing checks for #576 --- .github/workflows/backend-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 0a67171d..3976b4f4 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v5 with: - node-version: $+{{ matrix.node-version }} + node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: stellar-payment-platform/package-lock.json @@ -33,7 +33,7 @@ jobs: - name: Run memory leak detection tests (#511) working-directory: stellar-payment-platform - run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPathPattern=memory + run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPattern=memory env: MEMORY_TEST_REQUESTS: '200' - MEMORY_LEAK_THRESHOLD_MB: '50' + MEMORY_LEAK_THRESHOLD_MB: '50' \ No newline at end of file From 332804a04debb9e1bea7421c0309e64b45863632 Mon Sep 17 00:00:00 2001 From: BIGMEECHXBT Date: Tue, 1 Sep 2026 11:11:30 +0100 Subject: [PATCH 8/8] fix(ci): resolve failing checks for #576 --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c6c6bb6..15aba8f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,7 @@ name: Production Safety Checks -on: - push: - branches: [ "main" ] +n: push: + braches: [ "main" ] pull_request: branches: [ "main" ] @@ -13,6 +12,22 @@ jobs: defaults: run: working-directory: ./stellar-payment-platform + services: + postgres: + image: postgres:16 + env: + POSTGRES_USER: postgres + POSTRESE_PASSWORD: postgres + POSTRESE_DB: stellar_payment_test + ports: + - 5432:5432 + options: >- + --health-cmd pgisready -U postgres + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + DATABASE_URL: postgresql://postgres:postgres@localhost:5432/stellar_payment_test steps: - name: Checkout Code uses: actions/checkout@v5 @@ -27,11 +42,14 @@ jobs: - name: Install Backend Dependencies run: npm install --legacy-peer-deps + - name: Run Database Migrations + run: npm run migrate + - name: Run Backend Tests run: NODE_ENV=test npm test - name: Run Memory Leak Detection Tests (#511) - run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPathPattern=memory + run: NODE_ENV=test node --expose-gc node_modules/.bin/jest --forceExit --testPattern=memory env: MEMORY_TEST_REQUESTS: '200' MEMORY_LEAK_THRESHOLD_MB: '50'