remotestorage / remotestorage.js

⬡ JavaScript client library for integrating remoteStorage in apps
https://remotestoragejs.readthedocs.io
MIT License
2.32k stars 141 forks source link

Wrong `backend` value when not connected on app start #1091

Open galfert opened 6 years ago

galfert commented 6 years ago

When no storage is connected yet, remoteStorage.backend already has the value "remotestorage".

But when connecting a storage and then disconnecting, remoteStorage.backend is undefined.

The value should be undefined in the beginning as well.

raucao commented 6 years ago

It's not really a bug, is it? This is not meant to indicate connection state, and the default is remotestorage after all.

galfert commented 6 years ago

But it's inconsistent from when you disconnect. So I would count that as a bug.

galfert commented 6 years ago

I think we should also mention this property in the documentation for Dropbox/Google Drive.

raucao commented 6 years ago

But it's inconsistent from when you disconnect. So I would count that as a bug.

My point was that the bug could just as well be that it's undefined after disconnecting. In fact, undefined is worse than a default value imo, because it's usually used for things that are literally not defined, instead of e.g. a null value for something that is defined, but has no value.