Skip to content

Node.js Client doesn't sort field names during compact schema creation [API-2376] #1576

Closed

Description

@yuce

Describe the bug

The compact Schema class doesn't sort all of its fields by name before creating the Rabin fingerprint.
Node.js client sorts the fields by field name while writing it, but that's too late, Rabin fingerprint is already calculated.
That causes the possibility of having two different Rabin fingerprints for two Schemas with the same fields in different order.

Expected behavior

Schema objects with the same fields must have the same Rabin fingerprint, regardless of their order in the schama.

Java, Go, .Net, and Python client libraries sort the fields by their names during Schema initialization.

To Reproduce

The following two code samples must produce the same Rabin fingerprint.

(1)

const schema = new Schema('my-schema', [
    new FieldDescriptor('field-1', FieldKind.ARRAY_OF_DATE),
    new FieldDescriptor('field-2', FieldKind.ARRAY_OF_DATE),
]);
const fp = RabinFingerprint64.ofSchema(schema);

(2)

const schema = new Schema('my-schema', [
    new FieldDescriptor('field-2', FieldKind.ARRAY_OF_DATE),
    new FieldDescriptor('field-1', FieldKind.ARRAY_OF_DATE),
]);
const fp = RabinFingerprint64.ofSchema(schema);

Activity

  1. github-actions commented on Feb 5, 2026

    @github-actions

    Internal Jira issue: API-2376

  2. changed the title [-]Node.js Client doesn't sort field names during compact schema creation[/-] [+]Node.js Client doesn't sort field names during compact schema creation [API-2376][/+] on Feb 5, 2026
  3. added a commit that references this issue on Feb 9, 2026
    88f6333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions