fix: add missing routePositions column to PG/MySQL traceroutes baseline#2390
fix: add missing routePositions column to PG/MySQL traceroutes baseline#2390
Conversation
The traceroutes table in PostgreSQL and MySQL baselines was missing the routePositions column that exists in SQLite and the Drizzle schema. This caused 500 errors on traceroutes/recent, v1/network, and v1/network/topology endpoints on PG/MySQL backends. Also adds comprehensive API exercise test script (tests/api-exercise-test.sh) that exercises 80+ endpoints across all API surfaces. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job Reviewing this PR for code quality, best practices, potential bugs, performance considerations, security concerns, and test coverage. Review Checklist
📋 Review SummaryThis PR successfully fixes a critical database schema inconsistency and adds valuable testing infrastructure. The changes are well-implemented and safe. ✅ What's Working Well
🔍 Code Quality AssessmentMigration Changes:
Test Script:
🛡️ Security Considerations
🚀 Performance Impact
🧪 Test Coverage ImprovementsThe API exercise test is a significant improvement to testing infrastructure:
|
Added ~55 more safe GET endpoints covering settings sub-routes, maintenance, backups, push notifications, apprise, themes, map preferences, ghost nodes, announcements, channels debug, telemetry available nodes, messages channels/unread, route segments, security export, V1 docs/search, and more. Found 2 pre-existing 500 bugs: - GET /api/user/map-preferences — fails to fetch - GET /api/system/backup/list — "no such column: dirname" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job 📋 Review SummaryThis PR successfully fixes a critical database schema inconsistency and adds valuable testing infrastructure. The changes are well-implemented and safe. ✅ What's Working Well
🔍 Code Quality AssessmentMigration Changes:
Test Script:
🛡️ Security Considerations
🚀 Performance Impact
🧪 Test Coverage ImprovementsThe API exercise test is a significant improvement to testing infrastructure:
|
…columns systemBackupService.listBackups() used 6 wrong column names (dirname, type, size, table_count, meshmonitor_version, schema_version) that don't match the actual schema (backupPath, backupType, totalSize, tableCount, appVersion, schemaVersion). Fixed query and result mapping. SQLite baseline user_map_preferences was missing all display preference columns (map_tileset, show_paths, show_neighbor_info, etc.) that the User model queries for, causing 500 on GET /api/user/map-preferences. Added 11 missing columns to baseline. Also fixed userId → user_id to match the column name the code expects. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job Reviewing this PR for code quality, best practices, potential bugs, performance considerations, security concerns, and test coverage. Review Checklist
📋 Review SummaryThis PR successfully fixes a critical database schema inconsistency and adds valuable testing infrastructure. The changes are well-implemented and safe. ✅ What's Working Well
🔍 Code Quality AssessmentMigration Changes:
Test Script:
🛡️ Security Considerations
🚀 Performance Impact
🧪 Test Coverage ImprovementsThe API exercise test is a significant improvement to testing infrastructure:
|
getMapPreferences used hardcoded snake_case column names that may not exist on v3.7+ fresh installs. Now uses SELECT * and handles both snake_case and camelCase column names, plus user_id/userId variations. Also updated migration 007 to add missing columns on SQLite (previously was a no-op assuming pre-v3.7 migration 030 had already added them). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job 📋 Review SummaryThis PR successfully fixes a critical database schema inconsistency and adds valuable testing infrastructure. The changes are well-implemented and safe. ✅ What's Working Well
🔍 Code Quality AssessmentMigration Changes:
Test Script:
🛡️ Security Considerations
🚀 Performance Impact
🧪 Test Coverage ImprovementsThe API exercise test is a significant improvement to testing infrastructure:
|
SQLite PRAGMA table_info detects which column name exists before querying, handling both pre-v3.7 (user_id) and v3.7+ (userId) schemas. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job 📋 Review SummaryThis PR successfully fixes a critical database schema inconsistency and adds valuable testing infrastructure. The changes are well-implemented and safe. ✅ What's Working Well
🔍 Code Quality AssessmentMigration Changes:
Test Script:
🛡️ Security Considerations
🚀 Performance Impact
🧪 Test Coverage ImprovementsThe API exercise test is a significant improvement to testing infrastructure:
|
PG and MySQL route_segments tables were missing fromLatitude, fromLongitude, toLatitude, toLongitude columns that exist in SQLite baseline and Drizzle schema, causing 500 on route-segments endpoints. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Summary
routePositionsTEXT column to PostgreSQL and MySQL traceroutes table baselinestests/api-exercise-test.sh) that exercises 80+ endpointsEndpoints fixed
GET /api/traceroutes/recent— 500 → 200GET /api/v1/network— 500 → 200GET /api/v1/network/topology— 500 → 200Test Plan
npx vitest run— 3070 tests pass, 0 failures🤖 Generated with Claude Code