valkey-io / valkey-glide

An open source Valkey client library that supports Valkey and Redis open source 6.2, 7.0 and 7.2. Valkey GLIDE is designed for reliability, optimized performance, and high-availability, for Valkey and Redis OSS based applications. GLIDE is a multi language client library, written in Rust with programming language bindings, such as Java and Python
Apache License 2.0
279 stars 58 forks source link

Node package is missing the Server Modules (FT and JSON) in the 1.2.0 RC packages #2755

Closed jbrinkman closed 3 days ago

jbrinkman commented 4 days ago

Describe the bug

The Valkey-Glide 1.2.0-rc16 package is missing the server-modules folder. As a result, the FT and JSON module commands result in an error when trying to call those commands.

import { GlideClient, GlideClusterClient, Logger, GlideJson } from "@valkey/valkey-glide";

const client = await GlideClient.createClient({
    addresses: addresses,
    clientName: "test_standalone_client",
});

const jsonObj = { a: 1, b: 2, c: "three" };
const json_set_response = await GlideJson.set(client, "jfoo", "$", JSON.stringify(jsonObj));

Expected Behavior

The code should run without errors and add the jsonObj to the root of the jfoo key.

Current Behavior

The following error is thrown when the code is executed against the 1.2.0-rc16 package. logger_core: received error - An error was signalled by the server - ResponseError: unknown command 'JSON.SET', with args beginning with: 'jfoo' '$' '{"a":1,"b":2,"c":"three"}'

Reproduction Steps

  1. Create a simple Node project
  2. Install the latest RC of the @Valkey/Valkey-glide package
  3. Add the code shown above to the index.s
  4. Run the code

Possible Solution

No response

Additional Information/Context

No response

Client version used

@valkey/valkey-glide@1.2.0-rc16

Engine type and version

Valkey 8

OS

MacOS 14

Language

TypeScript

Language Version

Using Vanilla JS not TypeScript

Cluster information

No response

Logs

No response

Other information

No response

jbrinkman commented 4 days ago

This may not be a bug at all, and is likely the result of testing against a server that doesn't support JSON commands. Using redis-stack docker image does not result in an error.

@ikolomi @avifenesh Please confirm.

acarbonetto commented 4 days ago

There's still an issue, that the GlideJson and GlideFt classes (and options) are not being included in the @valkey-glide/valkey-glide package.

image
acarbonetto commented 4 days ago

Also, note that the arch variant (which is available) DOES have the server-modules packages (I guess that's a very poor workaround).

image
// not available:
import {GlideJson} from "@valkey/valkey-glide";

// available:
import { GlideJson } from "@valkey/valkey-glide-darwin-arm64";
avifenesh commented 4 days ago

@jbrinkman Good catch! thanks!