Bug: Creating a StringRecordId without an id in the string fails and causes the database connection to sever. #371
Labels
bug
Something isn't working
pending surrealdb fix
This issue depends on an issue in the SurrealDB repository
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?
Code of Conduct
The text was updated successfully, but these errors were encountered: