Skip to content

Unify and simplify JavaScript record model for user-defined indexes  #5438

@qodo-code-review

Description

@qodo-code-review

Description

  • The JavaScript record representation used in user-defined indexes had inconsistent property names and structure compared to connectors
  • The evaluator was creating new function instances and record objects repeatedly, causing unnecessary allocations
  • The codebase needed a cleaner separation between record mapping and expression evaluation logic

Deliverables

  • Unified model: Create JsRecord class with consistent property names matching connector conventions (schema, properties, id, sequence, redacted)
  • Lazy deserialization: Implement lazy-loaded Value and Properties to avoid deserializing data that may not be accessed
  • Evaluator pattern: Extract evaluation logic into JsRecordEvaluator with function caching to reduce allocations
  • Type conversion: Add enum-to-string converter to Jint engine for proper enum handling in JavaScript
  • Documentation update: Update user-defined index documentation to reflect new record structure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions