pr-1-feedback #2

Merged
lentil merged 10 commits from pr-1-feedback into main 2025-06-15 14:26:31 -05:00
Owner

Changes

  1. Negation & Query Handling

    • Improved negation chain handling and logging
    • Added JSON Logic operator validation with enhanced error messages
    • Fixed recursion depth test validity
  2. Data Resolution

    • Moved common resolve logic to base Lossy class
    • Enhanced handling of undefined values in custom resolvers
    • Fixed entity schema validation to require all properties
  3. Code Quality

    • Removed unused _RhizomeImports from test files
    • Moved CommonSchemas to test-utils
    • Removed data/ and test-data/ from repository
    • Updated documentation about LastWriteWins tie-breaking

Testing

  • Includes updates to negation tests
  • Enhanced test coverage for schema validation
  • Improved test data organization
### Changes 1. **Negation & Query Handling** - Improved negation chain handling and logging - Added JSON Logic operator validation with enhanced error messages - Fixed recursion depth test validity 2. **Data Resolution** - Moved common resolve logic to base Lossy class - Enhanced handling of undefined values in custom resolvers - Fixed entity schema validation to require all properties 3. **Code Quality** - Removed unused `_RhizomeImports` from test files - Moved `CommonSchemas` to test-utils - Removed data/ and test-data/ from repository - Updated documentation about LastWriteWins tie-breaking ### Testing - Includes updates to negation tests - Enhanced test coverage for schema validation - Improved test data organization
lentil added 10 commits 2025-06-15 14:16:41 -05:00
Addresses PR feedback about the outdated comment in concurrent-writes.ts. The comment now accurately reflects that the resolution uses the LastWriteWins resolver's tie-breaking algorithm rather than delta processing order.
- Moved CommonSchemas from src/schema/schema.ts to src/test-utils/schemas.ts
- Updated all test files to import CommonSchemas from the new location
- Fixed the Document schema to match test expectations by making the author field required
- Added additional fields to the Document schema to match the original implementation
- Ensured all tests pass with the new implementation

Addresses PR feedback that CommonSchemas is only used in tests and should be moved to test files.
Previosly a failure to correctly limit the depth might not be detected
- Moved the resolve method implementation from individual resolvers to the base Lossy class
- Updated initializer methods to accept a LosslessViewOne parameter
- Removed redundant resolve methods from LastWriteWins, TimestampResolver, CustomResolver, and AggregationResolver
- Ensured consistent behavior across all resolver implementations
- All tests passing with the refactored code
- Removed unused _RhizomeImports from:
  - __tests__/compose-decompose.ts
  - __tests__/transactions.ts
  - __tests__/negation.ts
- All tests continue to pass after removal
- Update ResolverPlugin interface to allow resolve() to return undefined
- Modify CustomResolver to skip properties with undefined values
- Add test case for resolvers that return undefined
- Update existing tests to handle cases where no properties are resolved

This change makes the behavior more explicit when resolvers don't return a value,
which is particularly important for numeric aggregations where 0 might be a valid result.
- Add validation for JSON Logic operators in query filters
- Throw InvalidQueryOperatorError for invalid operators
- Improve error handling and logging in applyJsonLogicFilter
- Update tests to verify new error handling behavior
- Fix TypeScript linting issues and improve code style
- Refactored isDeltaNegated to properly handle complex negation chains
- Added recursive negation detection to account for negations of negations
- Replaced console.log with debug statements in tests
- Improved test coverage and documentation
- Fixed TypeScript type issues
lentil merged commit 1b9ed0a6dd into main 2025-06-15 14:26:31 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lentil/rhizome-node#2
No description provided.