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: Creating a StringRecordId without an id in the string fails and causes the database connection to sever. #371

Open
2 tasks done
knackstedt opened this issue Nov 11, 2024 · 2 comments
Labels
bug Something isn't working pending surrealdb fix This issue depends on an issue in the SurrealDB repository

Comments

@knackstedt
Copy link
Contributor

Describe the bug

e.g. db.create(new StringRecordId("foobar"), data)

If you provide a stringRecordId without an ID in db.create (possibly other methods as well) the connection terminates and throws this error: There is no connection available at this moment.

The database should not have connections severed because of malformed input.

Partly related to #354, where the error message is just unclear. In this case I think it's a bug as I would expect this to just create the record with a random ID.

Steps to reproduce

Run db.create with a new StringRecordId that doesn't contain and ID.

Expected behaviour

The database should either create the new object with a random ID or the SDK should throw an exception that the string format is invalid.

SurrealDB version

2.0.4 for linux on x86_64

JavaScript SDK version

1.0.6

Contact Details

[email protected]

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
@knackstedt knackstedt added the bug Something isn't working label Nov 11, 2024
@kearfy
Copy link
Member

kearfy commented Nov 11, 2024

Hey @knackstedt, We need to do some work on SurrealDB's side to be able to solve this, you can track the following issue: surrealdb/surrealdb#4528
I'll leave this open in the meantime!

@kearfy kearfy added the pending surrealdb fix This issue depends on an issue in the SurrealDB repository label Nov 20, 2024
@kearfy
Copy link
Member

kearfy commented Nov 20, 2024

Duplicate of #325

@kearfy kearfy marked this as a duplicate of #325 Nov 20, 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 pending surrealdb fix This issue depends on an issue in the SurrealDB repository
Projects
None yet
Development

No branches or pull requests

2 participants