Skip to content

Latest commit

 

History

History
113 lines (76 loc) · 3.69 KB

File metadata and controls

113 lines (76 loc) · 3.69 KB

Quick Reference: Issues Fixed

🔧 Issue #307: Governance Pagination

What was broken: Loading all proposals at once = slow & unbounded queries

Files Changed:

  • ✅ backend/src/db/schema.ts - Added proposals table
  • ✅ backend/src/api/controllers/GovernanceController.ts - NEW (list + detail endpoints)
  • ✅ backend/src/routes/governance.routes.ts - NEW (route handlers)
  • ✅ backend/src/index.ts - Registered governance router
  • ✅ frontend/src/app/governance/page.tsx - Uses real API with pagination

Result: 20 proposals per page, Previous/Next buttons, proper loading states

API Example:

GET /api/governance/proposals?page=1&limit=20&status=active

🔧 Issue #295: useCreateMarket Date Validation

What was broken: new Date("not-a-date").getTime() produces NaN → silently converts to 0n in BigInt

File Changed:

  • ✅ frontend/src/hooks/useCreateMarket.ts - Added validateScheduledAt() function

Validation Checks:

  1. ISO 8601 format check (rejects malformed dates)
  2. Future date check (rejects past dates)
  3. Clear error messages before transaction building

Example Error:

"Invalid date format: "not-a-date". Expected ISO 8601 format (e.g., "2025-02-15T14:30:00Z")"

🔧 Issue #308: Wallet Connection (Albedo Blocked)

What was broken: Freighter check throws error before Albedo code path → Albedo users blocked

File Changed:

  • ✅ frontend/src/services/wallet.ts - Fixed connectWallet() logic

Before: if (freighter) { ... } if (albedo) { ... } throw → error if freighter missing After: Try freighter → fallback to albedo → throw only if both missing

Result: Freighter users see Freighter, Albedo users see Albedo, both can connect


🔧 Issue #290: Indexer DB Pool Exhaustion

What was broken: Each Jest import creates new pg.Pool instance → test DB max connections exceeded

Files Changed:

  • ✅ indexer/src/db.ts - Lazy singleton pattern
  • ✅ indexer/src/__tests__/indexer.test.ts - Updated cleanup to use getDatabase()

Change: Module now creates pool only on first access, reuses for all subsequent calls

Result: Single pool instance across entire test suite; tests don't exhaust DB connections


📊 Files Modified Summary

File Change Type
backend/src/db/schema.ts Added proposals table Schema
backend/src/api/controllers/GovernanceController.ts NEW governance endpoints New
backend/src/routes/governance.routes.ts NEW routes New
backend/src/index.ts Registered governance router Config
frontend/src/app/governance/page.tsx Pagination + real API Feature
frontend/src/hooks/useCreateMarket.ts Date validation Fix
frontend/src/services/wallet.ts Independent wallet checks Fix
indexer/src/db.ts Lazy singleton Fix
indexer/src/__tests__/indexer.test.ts Updated cleanup Test

✅ Verification Checklist

  • Governance pagination works end-to-end
  • useCreateMarket rejects invalid dates with clear errors
  • Wallet connection allows both Freighter and Albedo users
  • Indexer tests don't exhaust DB connections
  • All changes backward compatible
  • No breaking API changes
  • TypeScript compilation ready

🚀 How to Deploy

  1. Migrate database (if not auto-migrated):

    • Create proposals table with schema from ISSUES_FIXED.md
  2. Deploy backend:

    • Push backend changes (includes governance routes)
  3. Deploy frontend:

    • Push frontend changes (governance page + wallet/hook fixes)
  4. Deploy indexer (separate):

    • Push indexer changes (lazy loading fix)

No downtime, no breaking changes.