objectbox-java
objectbox-java copied to clipboard
Download All in Objectbox Admin fails
Hello,
from version 3.1.0 and above it is not possible to download the tables in ObjectBox Admin anymore. It just responses 401 - Session ID not present.
When I downgrade Objectbox to 3.0.1, download is possible.
Steps to Reproduce:
- Create Android App project
- In app.java:
@Override
public void onCreate() {
[...]
if (BuildConfig.DEBUG_MODE) {
/* Admin objectBoxAdmin = new Admin(getObjectBoxIO().getBoxStore(this.getBaseContext()));
objectBoxAdmin.start(this);
objectBoxAdmin.setNotificationId(1);*/
AndroidObjectBrowser objectBrowser = new AndroidObjectBrowser(getObjectBoxIO().getBoxStore(this.getBaseContext()));
objectBrowser.setNotificationId(1);
objectBrowser.start(this.getBaseContext());
/*Admin archieveBoxAdmin = new Admin(getArchiveBoxIO().getBoxStore(this.getBaseContext()));
archieveBoxAdmin.setNotificationId(2);
archieveBoxAdmin.start(this);*/
AndroidObjectBrowser archiveBrowser = new AndroidObjectBrowser(getArchiveBoxIO().getBoxStore(this.getBaseContext()));
archiveBrowser.setNotificationId(2);
archiveBrowser.start(this.getBaseContext());
}
[...]
}
- start application on emulator
- In Terminal:
adb forward tcp:8090 tcp:8090
adb forward tcp:8091 tcp:8091
- Open Objectbox Admin in browser on dev machine and click on download all.
I tried both the deprecated syntax via AndroidObjectBrowser and the new one calling new Admin(...). The result is the same in both ways.
Note, that my app addresses two databases in which I store in different locations by setting the file path via
MyObjectBox.builder()
.name("dbxyz")
.androidContext(context.getApplicationContext())
.build();
in the wrapper classes ObjectBoxIO and ArchiveBoxIO.
Best regards Thomas
Thanks for reporting! I can confirm. But actually this does not work as of version 3.1.1, version 3.1.0 is not affected.
This is likely related to the change away from cookies towards an authorization header for authorization. We'll update this once we know when a fix is available.
any update on this?
@leononly Sorry, not yet. Note that a workaround is to write code that writes your objects as JSON (e.g. using Gson).
Out of interest, what would you be using that functionality for?
Fixed internally; will be part of the next release.
This was fixed with the 3.6.0 release.