Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
This repository was archived by the owner on Nov 21, 2026. It is now read-only.

GraphBatch.new_edges drops edges without a word when its sequences differ in length, and create_vertices stores a non-str property name as text #318

Closed

Description

@tae898

Level: bindings. Found by the 2026-10-14 re-hunt of the read and write transports (main 708061d, the wheel's engine jars, JDK 25).

GraphBatch.new_edges(source_rids, edge_type, destination_rids, properties) pairs its three sequences with zip(), which stops at the shortest one without a word. So a properties list one dict short buffers one edge fewer and returns normally, and properties=[] buffers none. The same call without properties is checked (the Java side raises IllegalArgumentException, surfaced as ArcadeDBError), and the docs say the sequences have the same length. A caller whose properties list is shorter than its RIDs, or whose RID lists differ in length when properties are given, loses edges silently.

A second symptom of the same cause, the JSON bulk paths not checking their arguments: a property name that is not a str is written by json.dumps as text, so create_vertices("V", [{1: "a"}]) stores a property called 1, {True: "a"} one called true, and {None: "a"} one called null. insert_many, Document.set, and new_edge refuse such a name, and create_vertices refuses it too when another value in the call sends it through the per-value path (#111 fixed the same thing for dict keys inside values).

Repro (repros/repro-1-new-edges-length.py, saved output out/repro-1-new-edges-length.main.txt):

3 sources, 3 destinations                        no error   edges added: 3
3 sources, 2 destinations                        ArcadeDBError edges added: 0
3, 3, 3 property dicts                           no error   edges added: 3
3, 3, 2 property dicts                           no error   edges added: 2
3, 2, 3 property dicts                           no error   edges added: 2
3, 3, properties=[]                              no error   edges added: 0
create_vertices with a int property name stored the property ['1']
create_vertices with a bool property name stored the property ['true']
create_vertices with a None property name stored the property ['null']

The fix: new_edges reads its sequences once, compares the lengths before it buffers anything, and raises ArcadeDBError on a mismatch (the exception type the no-properties case already had); a non-str property name takes the per-value path, which refuses it. Tests first, in the pull request.

Activity

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

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