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

PouchDB Problem #228

Closed
ghost opened this issue Feb 27, 2018 · 10 comments
Closed

PouchDB Problem #228

ghost opened this issue Feb 27, 2018 · 10 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 27, 2018

Is it a bug or a feature request?

  • It's a bug.

Which version are you using?

  • Linux

Which is the version/distribution of the OS?

  • Ubuntu Gnome 16.04.4 64-Bit

Describe your issue

  • Can't save a new invoice

Steps to replicate

  • open app
  • fill in the required fields
  • click "save & preview"

Additional infos

  • i tested the .deb package, the appimage and installed with yarn from source
  • the appimage is additionaly almost unusable for me, because of some strange flickering, but the deb package and "yarn start" work well, except the described bug
  • after clicking the save button, there are showing 2 notification overlays with "undefined"
  • in the devtools console you can see that the app failed to open indexeddb (details in the screenshot)
    bildschirmfoto-20180227202803-2583x525

Any idea what might be the problem? i looked for myself, but i have little experience with react or pouchdb, so i dont really know where to start. on the other side, i have a frontend dev background, so maybe i can help fix it ... or help with some features, as soon as i get it running :)

i really like the direction of manta, i was literally planning something like this for myself, for almost the same reasons, then i read about your app in the codrops newsletter. perfect timing, thanks!

@ghost
Copy link
Author

ghost commented Feb 27, 2018

Seems to be a Problem with electron, indexdb is not reachable. if i create a indexeddb database in the devtools console (of the eclectron manta app) with indexedDB.open("test");, i get the following error:

IDBOpenDBRequest {onblocked: null, onupgradeneeded: null, source: null, transaction: null, readyState: "pending"…}
error: DOMException: Internal error opening backing store for indexedDB.open.
code: 0
message: "Internal error opening backing store for indexedDB.open."
name: "UnknownError"

Creating a indexeddb in Chromium works fine. So i guess it's something with electron.

@ghost
Copy link
Author

ghost commented Feb 27, 2018

Ok, i found the reason, why indexeddb is not reachable, but not the why. The AppImage package is causing this. I restarted the OS and all worked fine after launching the app with yarn. After that i closed the yarn instance and opened the appimage version. And indexeddb access was broken again. Also in the yarn instance, i opened after i closed the appimage instance.

@ghost
Copy link
Author

ghost commented Feb 27, 2018

Same Problem with the .deb package ...

How can i debug a packaged version of the app?

@hql287
Copy link
Owner

hql287 commented Feb 28, 2018

Hi @jens-t , my apologies for this inconvenience. A couple of questions:

  • What's the version of Manta (packed app) that you're using?
  • Can you use the app via the dev-server without any problem? (Given that you're only running this instance and there's no instance of the packed app is running)
  • Can you try yarn release:linux then run the exported app and see if the problem still persists?

@ghost
Copy link
Author

ghost commented Feb 28, 2018

The Version of the App packages i tested was 1.1.2 ... (appimage/deb)
And yes, I can use the app with the dev server without any problems, as long as there runs no packaged app before or in parallel.

As soon as i can test a self exported package, i post the results.

@hql287 hql287 added the bug label Feb 28, 2018
@ghost
Copy link
Author

ghost commented Feb 28, 2018

Ok, i've tested the "self build versions", same Problem with .deb & .appimage ...
I investigte further. Found some electron debug tools that should help. devtron is already installed. electron-debug in combination with devtron & electron-react-devtools seems good to me.

@ghost
Copy link
Author

ghost commented Feb 28, 2018

Tested the linux packages with forced devtools. The problem seems to be that the app is not properly closing on its own. so if you open the app the second time indexeddb is blocked by the app opened before running in the background. if i start the app from the terminal, i can kill the app completely, stat it a second time and everything is fine.

Don't know yet why the app is not closing properly over the ui ...

Edit: If i close the app with "Invoice -> Quit App" or "CTRL + Q" the app is really closed. only the window close button is causing this ...

Edit2: Ok, found the part thats causing this. I send a pull request ...

@hql287
Copy link
Owner

hql287 commented Mar 1, 2018

@jens-t Ok this confirms it.

The pouchDB document is not very helpful on this but from my experience, when this issue comes up, 99% of the time it has something to do with multiple instances of the app is running so one of them cann't connect properly. So if you run the dev server and then open the exported app, the same issue would show up.

@hql287
Copy link
Owner

hql287 commented Mar 1, 2018

Since we found the culprit, I guess this has more to do with the way Manta works rather than pouchDB. Feel free to change the title to something more relevant, or close the issue and open a new one if you want. Thanks!

@ghost
Copy link
Author

ghost commented Mar 1, 2018

Closing this ticket, followup in ticket #233 .

@ghost ghost closed this as completed Mar 1, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant