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

backtick escape issue for symbol #51

Open
cheduo opened this issue Jul 20, 2020 · 3 comments
Open

backtick escape issue for symbol #51

cheduo opened this issue Jul 20, 2020 · 3 comments
Labels

Comments

@cheduo
Copy link

cheduo commented Jul 20, 2020

Hi Michael,

I notice a small issue in sending Q symbol with backtick; Actually we need an extra space to escape the leading backtick. I just tested following code :

var nodeq = require("node-q");
nodeq.connect({host: "localhost", port: 5000}, function(err, con) {
    if (err) throw err;
    con.k("`a`b`c", function(err, res) {
        if (err) throw err;
        console.log("result", res); // Error a`b`c
    });    
    con.k(" `a`b`c", function(err, res) {
        if (err) throw err;
        console.log("result", res); // "result" [ 'a', 'b', 'c' ]
    });
});

We can hack it on user side by adding extra space to query string, but is it possible to fix it at package level ?

Thanks,
Duo

@michaelwittig
Copy link
Owner

Looks like KX Systems stops distributing a version of q that runs on macOS Catalina. Therefore, I can not reproduce your issue.

But by looking at the code, I can see that your case is not handled. You might want to try something like this:

con.k(["`a", "`b", "`c"], function(err, res) {

@cheduo
Copy link
Author

cheduo commented Jul 21, 2020

    con.k(["`a", "`b", "`c"], function(err, res) {
        if (err) throw err;
        console.log("result", res); // Error: s
    });

the issue is always about heading backtick,

    con.k(" `a", function(err, res) {
        if (err) throw err;
        console.log("result", res); // "result" a
    });
    con.k("`a", function(err, res) {
        if (err) throw err;
        console.log("result", res); // Error: type
    });

@michaelwittig
Copy link
Owner

You might want to try explicit types:

const nodeq = require("node-q");
[...]
con.k(nodeq. symbols(["a", "b", "c"]), function(err, res) {
	if (err) throw err;
	console.log("result", res); // 5
});

Sorry for not being more helpful here. Without q it's hard to test...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants