Back

Bug? πŸ› Passing '' as documentId returns a document?

  • 0
  • Databases
  • Cloud
memoonlite
31 Aug, 2024, 15:50

Hello everyone! πŸ‘‹πŸ»

I have the following piece of code (client side, Flutter):

TypeScript
        databaseId: 'id',
        collectionId: 'id',
        documentId: '');```

As you might have noticed, I'm passing an empty string as documentId. No such ID exists of course. But yet this code returns a document.

I expect the above code to return an exception. When I pass a random string as ID it indeed throws an exception, as it should be. But not when I pass an empty string (''). πŸ€”

Can anyone confirm that this is indeed a bug in Apprite?
TL;DR
Issue: Passing an empty string as documentId in AppWrite's getDocument function returns a document instead of throwing an exception. Solution: This behavior is likely a bug in AppWrite. Consider reporting it to the developers for further investigation and resolution.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more