Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: JS: Improve error handling of batch addition #510

Open
wants to merge 4 commits into
base: main-dev
Choose a base branch
from

Commits on Nov 1, 2024

  1. Fix: JS: Improve error handling of batch addition

    Crash if there is an error in batch addition.
    Example:
    
    ```
    const usearch = require('usearch');
    const index = new usearch.Index({ metric: 'l2sq', connectivity: 16, dimensions: 3 });
    index.add(42n, new Float32Array([0.2, 0.6, 0.4]));
    index.add(
      [41n, 42n, 43n],
      [[0.1, 0.6, 0.4], [0.2, 0.6, 0.4], [0.3, 0.6, 0.4]]
    )
    ```
    
    `42n` is duplicated, which causes an error, but then it crash.
    
    It seems that it is not better to throw an exception during the process,
    so we changed it to throw it after it is completed.
    abetomo committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    482bc3a View commit details
    Browse the repository at this point in the history
  2. Update tests

    abetomo committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    b20a6e9 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2024

  1. Use mutex

    abetomo committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    8884a8d View commit details
    Browse the repository at this point in the history
  2. Use append instead of +

    abetomo committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    aaac9ec View commit details
    Browse the repository at this point in the history