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

Bug: JS Sdk disconnected and couldn't authenticate again #223

Open
2 tasks done
triracle97 opened this issue Apr 4, 2024 · 0 comments
Open
2 tasks done

Bug: JS Sdk disconnected and couldn't authenticate again #223

triracle97 opened this issue Apr 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@triracle97
Copy link

Describe the bug

Surrealdb js sdk disconnect and reconnect again but fail to authenticate
image

Steps to reproduce

I have a process which listen to a live query using this library and I'm hosting the DB inside docker on an vps, after around 1 day it tried to reconnect and failed to authenticate. My internet connection was ok all the time so I don't know why it disconnected and tried to reconnect.

Here is the code I'm using to connect to my db

const db = new Surreal();

async function initDb() {
  logger.info(`Connecting to ${process.env.SURREAL_URL} with NS ${process.env.ROOT_NS}, DB ${process.env.ROOT_DB}`);
  await db.connect(process.env.SURREAL_URL, {
    auth: {
      username: "root",
      password: "mypassword",
    },
    namespace: process.env.ROOT_NS,
    database: process.env.ROOT_DB,
  });
}

Expected behaviour

The connection should be consistent, and if it disconnect, it should be able to authenticate again

SurrealDB version

v1.3.1

SurrealDB.js version

0.11.0

Contact Details

triracle@gmail.com

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@triracle97 triracle97 added the bug Something isn't working label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant