Files
wownerogue/TODO.md
T

5.8 KiB

Wownerogue Development Todo

High Priority

  • Verify Server Startup: Server starts cleanly with npm run dev ✅
  • Test Payment Flow: Fixed critical bug where payment confirmation wasn't updating DB status ✅
  • Test Payouts: Confirm payouts are triggered correctly upon winning in paid modes.
  • Address Persistence: Verify that payout addresses persist across server restarts via session tokens. ✅
  • Mixed Mode Logic: Per-user mode determination based on credits balance ✅
  • Credits Package Bug: Credits correctly parsed from package info on confirmation ✅
  • Stagenet Support: Added MONERO_NETWORK config with UI warnings for non-mainnet ✅
  • Difficulty Tuning: Configurable presets (easy/normal/hard/casino) for house edge control ✅
  • Provably Fair: SHA-256 commitment scheme for verifiable game generation ✅

Recent Fixes (Jan 2026)

  • Payment DB Status Bug: Fixed critical issue where single_game payments weren't marked 'confirmed' in DB, causing game start to fail ✅
  • TileMap Character Error: Fixed '●' character not in tileMap causing tile mode rendering failures ✅
  • Test Suite Fixes: All 47 tests now pass, including security tests with mock DB fallback ✅

New Features (Just Added)

  • Chat History Persistence: ChatHistoryManager stores messages in PostgreSQL with 30-day retention ✅
  • Chat History on Connect: New users receive last 50 messages on connect via chat_history event ✅
  • Spectator System: Full spectator mode with SpectatorManager for watching live games ✅
  • Active Games List: Real-time game list with pagination, sorting, and auto-refresh ✅
  • Spectate UI: "Watch Games" button, live game panel, and spectator controls ✅
  • Spectator Broadcasts: Game updates broadcast to spectators via Socket.IO rooms ✅
  • Help Modal: Added instructions modal with game rules, controls, and payment mode info ✅
  • Dynamic Treasure Icon: Treasure tile now shows $W (Wownero) or $M (Monero) based on crypto type ✅
  • Address Status Indicator: Payout address button shows warning when no address is set ✅

User Feedback (Beta Tester - Dec 2025)

  • History Panel Bug: User reported payout not showing in History after winning with treasure (needs investigation - may be timing/status issue with "confirmed" vs "pending" payouts)
  • Early Dungeon Entry: Allow credits/free mode users to enter dungeon immediately without waiting for next block (risky - they die if block found before escape). Toggleable via config. ✅

Improvements / Refactoring

  • Error Handling: Extended normalizeError to queueHandler, queueManager, sessionManager ✅
  • Configuration Persistence: Added configPersistence.js for hot-reloadable DB-backed config ✅
  • Monitoring Dashboard: Created /admin.html with live metrics (games, queue, memory, wallet) ✅
  • Frontend Cleanup: Removed rot.js (using minified), game1.mid (unused), .DS_Store, moved tiles.xcf ✅
  • Provably Fair UI: Hash commitment shown at game start, seed revealed with verification link at game end ✅
  • Verification Endpoint: /verify/:gameId HTML page + /api/verify JSON endpoint for public verification ✅

Documentation

  • API Documentation: README updated with accurate API surface including health check and Socket.IO events ✅
  • Session Persistence: README documents session token behavior and localStorage requirements ✅
  • Difficulty System: README documents difficulty presets and house edge tuning ✅
  • Provably Fair: README documents cryptographic verification system ✅
  • Deployment Guide: README includes production deployment with Nginx/Caddy configs and systemd ✅

Pre-Beta Checklist

  • All 47 tests pass (9 test suites) ✅
  • Health check endpoint available at /health ✅
  • REST endpoints implemented: /api/user/:socketId/credits, /api/user/:socketId/mode, /api/user/:socketId/address ✅
  • Payout eligibility shown per payment mode in UI ✅
  • Session persistence tooltip and localStorage warning added ✅
  • Stagenet/testnet warning banner for Monero non-mainnet ✅
  • Chat history persisted and sent to new users ✅
  • Spectator system functional with live game viewing ✅
  • TLS/HTTPS: Configure reverse proxy (Nginx/Caddy) with SSL certificates before exposing to real users.
  • Database Backups: scripts/backup_db.sh + systemd timer for daily backups with 30-day retention (see LOGS_AND_BACKUP.md) ✅
  • Manual Integration Test: Run full payment flow with real wownero-wallet-rpc (not mocked).
  • Rate Limit Tuning: Current defaults (60 games/hour, 100 payouts/day) suitable for launch ✅
  • Log Rotation: Using systemd journald with configurable retention (see LOGS_AND_BACKUP.md) ✅

Known Issues / Future Improvements

Backend

  • Database Transactions: Wrap multi-step financial operations in transactions (credit deductions, payout processing)
  • Payment Idempotency: Replace in-memory Set with database-backed idempotency keys for payment confirmation
  • Payout Retry Queue: Implement automatic retry mechanism for failed payouts
  • Address Checksum Validation: Add cryptographic checksum validation for XMR/WOW addresses
  • Redis Rate Limiting: Replace in-memory rate limiter with Redis for persistence across restarts

Frontend

  • Socket Reconnection: Add reconnect and disconnect handlers to restore state after connection loss
  • Payment Timeout UI: Show countdown timer for payment expiration, auto-clean expired payment UI
  • Event Cleanup: Add proper cleanup for event listeners when modules are re-initialized
  • Connection Status Indicator: Show real-time socket connection state in UI