Skip to content

Conversation

@phernandez
Copy link
Member

Resolves #169

This PR addresses the character-related sync issues reported by users, specifically the IntegrityError "UNIQUE constraint failed: entity.file_path, entity.project_id".

Changes

  • Add pre-move validation to detect file path conflicts before database operations
  • Implement comprehensive conflict detection for case sensitivity, Unicode, and character encoding differences
  • Add utility functions for file path normalization and conflict analysis
  • Enhance error messages with specific guidance for different conflict types
  • Add comprehensive test coverage for character conflict scenarios
  • Create user documentation for character handling best practices

Issues Addressed

  • Hyphens/dashes conflicts between filenames and generated permalinks
  • Case sensitivity issues on macOS (Finance/ vs finance/)
  • Forward slash handling in file paths and metadata
  • Enhanced validation and error messaging

Generated with Claude Code

… operations

- Add pre-move validation to detect file path conflicts before database operations
- Implement comprehensive conflict detection for case sensitivity, Unicode, and character encoding differences  
- Add utility functions for file path normalization and conflict analysis
- Enhance error messages with specific guidance for different conflict types
- Add comprehensive test coverage for character conflict scenarios
- Create user documentation for character handling best practices

This resolves the IntegrityError "UNIQUE constraint failed: entity.file_path, entity.project_id" 
by detecting conflicts proactively and providing clear resolution guidance.

Addresses user feedback on:
- Hyphens/dashes conflicts between filenames and generated permalinks
- Case sensitivity issues on macOS (Finance/ vs finance/)  
- Forward slash handling in file paths and metadata
- Enhanced validation and error messaging

Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
@phernandez phernandez added the needs review A human needs to look at this issue label Jul 1, 2025
conflicts = []

# Get all existing file paths
all_entities = await self.repository.find_all()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how performant this will be for large numbers of entities

@groksrc groksrc merged commit fb1350b into main Aug 2, 2025
15 checks passed
@groksrc groksrc deleted the claude/issue-169-20250623_230107 branch August 2, 2025 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review A human needs to look at this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Sync error: Unique Constraint failed

4 participants