Skip to content

Conversation

@xav-db
Copy link
Member

@xav-db xav-db commented Oct 29, 2025

Summary

This PR integrates the fix from #670 into the arena-implementation branch. It resolves runtime errors when attempting to DROP non-existent nodes, edges, or vectors.

Problem

Queries attempting to drop non-existent items failed with:

Conversion error: Incorrect Type: Empty

This occurred because drop_traversal did not handle TraversalValue::Empty returned when querying for non-existent items.

Solution

Added TraversalValue::Empty => Ok(()) case in the match statement of drop_traversal in helix-db/src/helix_engine/traversal_core/ops/util/drop.rs:51.

This treats empty traversals as successful no-ops, making DROP operations idempotent.

Testing

  • cargo check passes with no errors
  • ✅ All 109 helix_engine tests pass, including all DROP-related tests

Related

Co-Authored-By: ishaksebsib

Greptile Overview

Updated On: 2025-10-29 11:44:54 UTC

Greptile Summary

Added handling for TraversalValue::Empty in DROP operations to prevent runtime errors when attempting to drop non-existent nodes, edges, or vectors.

  • Fixed "Conversion error: Incorrect Type: Empty" by treating empty traversals as successful no-ops
  • Implementation is consistent with how TraversalValue::Empty is handled elsewhere in the codebase (returns default/neutral values)
  • Makes DROP operations idempotent, which is expected behavior for deletion operations

Important Files Changed

File Analysis

Filename Score Overview
helix-db/src/helix_engine/traversal_core/ops/util/drop.rs 5/5 Added TraversalValue::Empty handling to gracefully treat empty traversals as no-ops in DROP operations

Sequence Diagram

sequenceDiagram
    participant Client
    participant HQL
    participant drop_traversal
    participant collect_to_obj
    participant Storage

    Client->>HQL: DROP N<NodeType>(non_existent_id)
    HQL->>collect_to_obj: Query for node by ID
    collect_to_obj->>Storage: Fetch node
    Storage-->>collect_to_obj: No results found
    collect_to_obj-->>HQL: TraversalValue::Empty
    HQL->>drop_traversal: Process traversal items
    alt Empty traversal (after fix)
        drop_traversal-->>HQL: Ok(()) - no-op
        HQL-->>Client: Success
    else Empty traversal (before fix)
        drop_traversal-->>HQL: ConversionError
        HQL-->>Client: Error: "Incorrect Type: Empty"
    end
Loading

This fix resolves runtime errors when attempting to DROP non-existent
nodes, edges, or vectors. Previously, empty traversals would throw
"Conversion error: Incorrect Type: Empty" errors.

Added TraversalValue::Empty => Ok(()) case to make DROP operations
idempotent - dropping non-existent items now succeeds silently.

Integrates PR #670 into the arena-implementation branch.

Co-Authored-By: ishaksebsib
@xav-db xav-db merged commit 4def294 into arena-implementation Oct 29, 2025
@xav-db xav-db deleted the fix-drop-empty-traversal branch October 29, 2025 11:44
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants