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

ConfigManager edward editor using wrong root #254

Closed
csabadm opened this issue Sep 23, 2019 · 4 comments
Closed

ConfigManager edward editor using wrong root #254

csabadm opened this issue Sep 23, 2019 · 4 comments

Comments

@csabadm
Copy link

csabadm commented Sep 23, 2019

  • Version : v14.0.0
  • Node Version : v12.10.0
  • OS : Ubuntu 18
  • Browser name/version: Chrome 77.0.3865.90

Using multiple prefix/doc root settings with config manager seems to make edward use the wrong doc root on save.

Example code:

const http = require('http');
const cloudcmd = require('cloudcmd');
const io = require('socket.io');
const app = require('express')();

const port = 8000;
const {createConfigManager} = cloudcmd;

const server = http.createServer(app);
const socket1 = io.listen(server, {
    path: `/root/socket.io`
});
const socket2 = io.listen(server, {
    path: `/abc/socket.io`
});
const socket3 = io.listen(server, {
    path: `/ccc/socket.io`
});

const configManager1 = createConfigManager();
configManager1('root', '/root');
configManager1('name', 'Cloudcmd test');

const configManager2 = createConfigManager();
configManager2('root', '/');

const configManager3 = createConfigManager();
configManager3('root', '/home');

app.use('/root', cloudcmd({
     socket1,
     configManager: configManager1,
}));

app.use('/abc', cloudcmd({
    socket2,
    configManager: configManager2,
}));

app.use('/ccc', cloudcmd({
    socket3,
    configManager: configManager3,
}));

server.listen(port); 

Anything I save using any of the prefixes gets saved using the doc root from configManager2

@coderaiser
Copy link
Owner

@csazku you can't just rename socket property 🙂.
Here is working example:

const http = require('http');
const cloudcmd = require('.');
const io = require('socket.io');
const app = require('express')();

const port = 8000;
const {createConfigManager} = cloudcmd;

const server = http.createServer(app);
const socket1 = io.listen(server, {
    path: `/root/socket.io`
});
const socket2 = io.listen(server, {
    path: `/abc/socket.io`
});
const socket3 = io.listen(server, {
    path: `/ccc/socket.io`
});

const configManager1 = createConfigManager();
configManager1('root', '/root');
configManager1('name', 'Cloudcmd test');

const configManager2 = createConfigManager();
configManager2('root', '/');

const configManager3 = createConfigManager();
configManager3('root', '/home');

app.use('/root', cloudcmd({
     socket: socket1,
     configManager: configManager1,
}));

app.use('/abc', cloudcmd({
    socket: socket2,
    configManager: configManager2,
}));

app.use('/ccc', cloudcmd({
    socket: socket3,
    configManager: configManager3,
}));

server.listen(port);

Can't set root, without a socket, listen will not be called and root wan't set up.

Is it works for you?

@csabadm
Copy link
Author

csabadm commented Sep 24, 2019

Sorry about, that I was in a hurry when putting the example together. In my actual live code the sockets are set up properly.
After correcting the example code the issue is still there, it but instead of configManager2 files get saved using whatever I set as root for configManager3 (seems like the last one gets used always)

@coderaiser coderaiser added bug and removed question labels Sep 24, 2019
coderaiser added a commit to cloudcmd/edward that referenced this issue Sep 24, 2019
@coderaiser
Copy link
Owner

coderaiser commented Sep 24, 2019

I get it 🙂, yes there was such a bug, it is fixed with cloudcmd/edward@a72a60c.

Landed in edward v11.2.0 🎉.
Landed in cloudcmd v14.0.1 🎉

Please reinstall Cloud Commander.
Is it works for you now?

coderaiser added a commit to cloudcmd/dword that referenced this issue Sep 24, 2019
coderaiser added a commit to cloudcmd/deepword that referenced this issue Sep 24, 2019
@csabadm
Copy link
Author

csabadm commented Sep 25, 2019

It's working now.
Thank you.

@csabadm csabadm closed this as completed Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants