Repository navigation
fix: rebrand note, Redis outage runbook, PII audit, mobile Pact tests (#126, #127, #129, #130) - #357
Merged
EmeditWeb merged 4 commits intoOct 19, 2026
Conversation
- Add AmanaMobile-AmanaBackend consumer tests covering create, deposit, confirm, release, dispute, detail, and list interactions on the versioned /api/v1 trade routes. - Wire bearer-token injection into the mobile API client and sync it from authStore so authenticated requests match the backend contract. - Send the required dispute category (default OTHER) from the mobile API. - Extend backend Pact provider verification to load the mobile pact file and mount the versioned trade router; stub the ESM-only https-proxy-agent for Jest and stabilise provider state statuses. - Remove a stale React import that broke mobile type-check.
|
@xsthar 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four issue-scoped changes bundled into one branch: the rebrand migration note (#126), mobile Pact contract tests (#127), the Redis outage settlement runbook (#129), and the PII encryption coverage audit (#130). Docs changes are additive; the only runtime code changes are the mobile API client/auth wiring and mobile dispute category needed to satisfy the verified backend contract.
#126 — Rebrand: EziAgric → EliteWork
docs/releases/2026-10-19-rebrand-eziagric-to-elitework.mdrecording the rename, a naming map of intentionally retained legacy identifiers (amana-escrow,AmanaFrontend/AmanaBackendpact names,amana-mobile), and a table of residual references with actionable follow-ups (README, i18n, infra docs, externalEziAgric/EziAgricissue links, shared schemas, contract overview doc).docs/releases/release-note-template.mdso new notes use the EliteWork name.#127 — Mobile Pact consumer contract tests
mobile/tests/pact/trades.pact.test.ts(consumerAmanaMobile, providerAmanaBackend) covering:POST /api/v1/tradesPOST /api/v1/trades/:id/depositPOST /api/v1/trades/:id/confirmPOST /api/v1/trades/:id/releasePOST /api/v1/trades/:id/disputeGET /api/v1/trades/:idGET /api/v1/trades?page=1&limit=10mobile/src/api/client.ts(setAuthToken) and kept it in sync fromauthStoreso authenticated requests actually carry the JWT the backend requires.category, the mobile client was sending onlyreason.tradeApi.initiateDisputenow sendscategory: 'OTHER'by default (the seeded fallback category).backend/src/__tests__/trades.pact.verify.test.tsto verify both frontend and mobile pact files, mount the versioned/api/v1/tradesrouter, set provider-state trade statuses, and stubbuildConfirmDeliveryTx/buildReleaseFundsTx.backend/src/__tests__/stubs/httpsProxyAgent.ts+ JestmoduleNameMapperbecause@pact-foundation/pact@16requires ESM-onlyhttps-proxy-agent@9at module load, which Jest's CJS runtime cannot parse.mobile/tests/pact/pacts/AmanaMobile-AmanaBackend.jsonsince the repo has no Pact broker/CI consumer-then-provider pipeline; the backend verifier now runs against it in CI.Reactimport inmobile/src/screens/AdminStreamScreen.test.tsxthat was failingpnpm type-check.#129 — Redis outage during active settlement
docs/runbooks/redis-outage-active-settlement.md: outage confirmation/scope, impact matrix per Redis consumer, containment and decision points, recovery ordering, settlement/payout-integrity SQL (PayoutIntent,Stream.lockedAt,StreamClawbackEvent,Trade), communication templates, rollback, and closeout/tabletop checklists.docs/runbooks/redis-maintenance.md, which claimed only payout-critical paths return 503; auth revocation/token-version checks fail closed, so authenticated trade/settlement routes can 503 during an outage.docs/redis-resilience.mdauth row (token version), added the admin session registry row, and linked both runbooks.redis_connection_failurealert runbook URL inbackend/src/config/alertRegistry.tsfrom the generic incident-response doc to the new runbook.#130 — PII encryption coverage audit
docs/pii-encryption.mdagainst the current Prisma schema: addedTradeNote.contentas encrypted, addedUser.displayName,NotificationPreference.phoneNumber,Dispute.reason, andTradeEvidence.filenameas plaintext gaps, and added an operational free-text review (InAppNotification,WebhookDeliveryAttempt,AdminActionAudit,Stream,ContractPauseLog,JobHeartbeat,EscrowAudit).NotificationPreference.phoneNumberstored/returned in plaintext) and F2 (User.displayName) are flagged High. F6 notesTradeNotesService.listNotesdecrypts withoutlogPiiAccess().backend/scripts/verify-pii-encryption.tswith theTradeNote.contentspec so the verifier enforces the newly documented inventory.Testing
Run locally on this branch:
mobile:pnpm exec jest tests/pact/trades.pact.test.ts --runInBand→ 7/7 passed.mobile:pnpm exec jest --silent→ 172/173 passed; the single failure (AdminStreamsOverviewScreen5s timeout) is an existing parallel-run flake and passes in isolation (--runInBand, 16/16).mobile:pnpm run type-check→ passed.mobile:pnpm run lint→ 0 errors (2 pre-existing warnings).backend:pnpm exec jest --config jest.config.js src/__tests__/trades.pact.verify.test.ts --runInBand --forceExit --coverage=false→ passed; all 7 mobile interactions verified against the provider (previously the test skipped when no pact files existed).backend:pnpm exec eslinton the changed files → 0 errors (1 pre-existingno-explicit-anywarning in the verifier script).Notes for reviewers
backend/scripts/verify-pii-encryption.tswas not executed here because it needs a populated database; the change is inventory-only.backendtsc --noEmitstill reports pre-existing errors insrc/__tests__/factories/mockFactories.tsandsrc/routes/stellar.ledger.tsthat are unrelated to this branch and were left untouched.Close #126
Close #127
Close #129
Close #130