uPhyca / stetho-realm

Realm module for Stetho
Other
738 stars 114 forks source link

Fails to return database tables with Realm 2.0 #37

Closed Dragas closed 7 years ago

Dragas commented 8 years ago

As of the latest realm update, stetho fails to return database tables and dumps the following into the console.

D/ChromeDevtoolsServer: Method not implemented: Not implemented: Worker.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Timeline.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Page.getNavigationHistory
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Worker.setAutoconnectToWorkers
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.requestDatabaseNames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.requestDatabaseNames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.requestDatabaseNames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.requestDatabaseNames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.requestDatabaseNames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.requestDatabaseNames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Page.getNavigationHistory
D/ChromeDevtoolsServer: Method not implemented: Not implemented: ApplicationCache.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: ApplicationCache.getFramesWithManifests

If stetho initialization for Realm 2.0 differs in any way from Realm 1.2, shouldn't it be mentioned in the readme.md?

sureshjoshi commented 8 years ago

+1

sureshjoshi commented 8 years ago

@Dragas Are you still running into this? Have you seen what might be causing it? I'm running into it too, and I'll start trying to debug it this weekend - but in the meantime if there is something you're running into that's obvious, it could be helpful.

Dragas commented 8 years ago

@sureshjoshi I still am running into it, but I didn't see anything else that looked obvious. Looking into other issues, #35 seems to be related as I'm getting the same downward arrow, signaling that database was expanded, without actual tables in it. Adding name parameter hides the default.realm table.

Then again, I didn't look much into it since debugging contents of the database wasn't my project's priority. Others who upvoted this issue seem to be running into it as well.

sureshjoshi commented 8 years ago

So, I found one problem. It's how the Realm instance is being opened (a little bit roundabout right now). However, essentially, if you have a named Realm instance, it will fail to open. If you remove the name of your database (keeping with the default.realm file) it will work.

This also poses a problem when you have multiple databases - as only one will get opened, but the data will display as the same for both.

sureshjoshi commented 8 years ago

@Dragas You can check out my PR to see how I got around this: 1) Change the database params to getName() from getPath() 2) Use only the default.realm, instead of named Realms

cknibbe commented 8 years ago

+1

zaki50 commented 7 years ago

I've released 2.1.0 that contains the fix. I'll close this issue.