feat: Prevent duplicate climbs based on selected holds#609
feat: Prevent duplicate climbs based on selected holds#609marcodejongh wants to merge 3 commits intomainfrom
Conversation
- Add frames encoding utility (`encodeMoonBoardHoldsToFrames`) to convert
holds to the `p{holdId}r{roleCode}` format used by the database
- Update saveClimb API to accept Moonboard requests with holds format
and convert to frames before saving
- Update MoonBoardCreateClimbForm to require authentication and save
climbs via the API instead of IndexedDB
- Update MoonBoardBulkImport similarly for batch saves
- Add direct database query for Moonboard climbs in list page since
GraphQL backend doesn't support Moonboard yet
- Skip GraphQL search and playlist operations for Moonboard to prevent
errors
- Add getMoonBoardDetails helper throughout codebase to handle Moonboard
board details separately from Aurora boards
- Enable MOONBOARD_ENABLED feature flag by default
- Remove IndexedDB saving functions (no longer needed)
- Restructure create form UI with header containing save button
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a holdsHash column to board_climbs for O(1) duplicate detection. When creating a climb, the system checks if an identical set of holds already exists (same board type, layout, and holds/states). Changes: - Add holdsHash column and index to board_climbs schema - Create holds-hash utility for deterministic hash generation - Update saveClimb to check for duplicates before inserting - Show duplicate warning in UI with link to existing climb - Compute hash during Aurora sync for new and existing climbs - Add backfill script for populating hash on existing climbs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Claude Review✅ Ready to merge - Minor issues noted below, but nothing blocking. Issues
|
- Add unit tests for generateHoldsHash utility (18 tests) - Move hash utility to @boardsesh/db to eliminate code duplication - Add unique partial index for atomic duplicate prevention - Handle race condition by catching unique constraint violations - Re-export hash functions from web package for backward compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
holds_hashcolumn with index for O(1) duplicate lookup instead of expensive JOINsChanges
Database
holds_hashcolumn toboard_climbstable(board_type, layout_id, holds_hash)for efficient lookupsBackend
generateHoldsHash()utility that produces deterministic hashes from framessaveClimbto check for duplicates before insertingisDuplicate,existingClimbUuid, andexistingClimbNameif duplicate foundFrontend
Scripts
backfill-holds-hash.tsscript to populate hash for existing climbsTest plan
npm run build:web→ passesnpm run db:migrate🤖 Generated with Claude Code