Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download All in Objectbox Admin fails #1095

Closed
Schmalztopf opened this issue Aug 23, 2022 · 5 comments
Closed

Download All in Objectbox Admin fails #1095

Schmalztopf opened this issue Aug 23, 2022 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Schmalztopf
Copy link

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

@Schmalztopf Schmalztopf added the bug Something isn't working label Aug 23, 2022
@greenrobot-team
Copy link
Member

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.

@greenrobot-team greenrobot-team self-assigned this Aug 23, 2022
@leononly
Copy link

any update on this?

@greenrobot-team
Copy link
Member

@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?

@greenrobot
Copy link
Member

Fixed internally; will be part of the next release.

@greenrobot-team greenrobot-team modified the milestones: Future release, 3.5.2 Mar 22, 2023
@greenrobot-team
Copy link
Member

This was fixed with the 3.6.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants