userbase icon indicating copy to clipboard operation
userbase copied to clipboard

Question: Why does the database owner need to open the database with the databaseName

Open Fubinator opened this issue 4 years ago • 1 comments
trafficstars

I have been wondering for some time why a database owner has to open their own databases with the name of the database. When opening a database, you must always check whether the user is the owner of the database or not. I understand why users who are not owners of a database cannot open it by name, but why can't an owner open the database using the ID? From a developer experience point of view, for me personally it would simplify a lot to always be able to open a database with the ID regardless of whether the user is the owner of the database or not.

Fubinator avatar Jan 12 '21 11:01 Fubinator

Valid question.

This was a precautionary measure that the internals of the SDK rely on to be extremely confident a user's database can't be corrupted when a developer calls openDatabase on an already open database, or when a user's connection to a database drops and reconnects.

It's possible to do and we'd like to do it - it will require a non-negligible amount of structural changes to the SDK to be sure it's safe in the above circumstances.

Will keep open until implemented.

j-berman avatar Jan 12 '21 19:01 j-berman