We’re pleased to announce MatchGrid 1.25.0, bringing comprehensive API validation, repository architecture improvements, and tightened data security to help you schedule with confidence.
What’s New
API Response Validation Layer
We’ve implemented runtime validation at the boundary between API responses and the frontend:
- 298 validation sites — All 37 API adapters now validate response shapes with Zod schemas before data reaches the UI
- Contract tests — Structural tests verify backend responses match frontend type expectations across all read models
- Loud failures — Response shape drift now surfaces immediately with exact field mismatches instead of silent rendering issues
- Full coverage — Tier 1, 2, and 3 adapters wired with comprehensive response contracts
CQRS-Inspired Repository Pattern
A new architecture for data access improves consistency and maintainability:
- Read/write separation — Clear organization of repository methods following CQRS principles
- Service-scoped repositories — New repositories for Season, Division, Region, and League with standardized patterns
- Documentation — Comprehensive REPOSITORY_CQRS_PATTERN guide for developers
- 100 request-scoped repos — Full coverage with consistent error handling and tenant isolation
Live Dashboard Recommendations
Dashboard recommendations now pull from the real scheduling engine:
- Real data — Replaced stubbed loadRecommendations with actual buildSeasonTruthWithContext and generateRecommendationsFromTruthV1
- Graceful degradation — Returns empty summary on failure rather than breaking the dashboard
- Actionable items — Top 5 recommendations with id, title, severity, and action paths
Error Boundary Instrumentation
Better diagnostics for sporadic rendering issues:
- Section-level boundaries — 40+ sections across 17 pages wrapped with error boundaries that capture data context at crash time
- Ring buffer logging — Safe serialization of props/state when errors occur for diagnosis
- Page coverage — 8 previously unwrapped pages now protected (dashboard, federations, regions, tournaments, and more)
Improvements
- Enhanced tenant isolation — Composite foreign key methods now include defense-in-depth tenant_id filters across 11 repository methods
- AI context builder RLS — All AI reads now go through RLS like every other user-facing operation; removed 15 getServiceClient bypasses
- Soft delete filters — Added deleted_at IS NULL to 30 queries across 6 repositories for consistent filtering
- Branded DB types — RequestDb and ServiceDb types improve type safety and prevent misuse of database clients
- Centralized storage keys — Consolidated localStorage constants (DEMO_SPORT_KEY, IMPERSONATION_KEY, billing keys) to prevent collisions
- Stale data fix — Changed global refetchOnMount from false to true to resolve stale-on-navigation bugs
Bug Fixes
- DTO shape mismatches — Resolved 11 CRITICAL, HIGH, and MEDIUM contract violations between backend read models and frontend types
- SQL query audit — Fixed 15 violations: 5 CRITICAL (missing columns, wrong joins) and 10 HIGH (hardcoded stubs) across read models
- Test reliability — Resolved 57 pre-existing test failures including tournament RLS, region summary, and worker mocks
- TypeScript quality — Five waves of fixes bringing errors from 667 to zero across repositories, routes, and services
- Structured logging — Replaced console.error with logger.error in catch blocks throughout the codebase
Technical
- 22-layer compliance — Migrated 38+ services to repository pattern; eliminated direct database access
- Service repository tokens — Replaced admin_internal with reasonWorker() across 27 service repositories for proper context
- RLS JWT claims — Gracefully skips check when DATABASE_URL unavailable (CI environments) while enforcing in production
- Scheduler purity lint — Updated to exclude false positives for bridge functions and type imports
How to Access
MatchGrid 1.25.0 is available now for all users. Simply log in to your account to access the latest features and improvements.
Have feedback or feature requests? We’d love to hear from you. Contact us or use the in-app feedback button.
— The MatchGrid Team