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

Loading secrets hangs inside a Flatpak #240

Open
mhoeher opened this issue Aug 16, 2023 · 2 comments
Open

Loading secrets hangs inside a Flatpak #240

mhoeher opened this issue Aug 16, 2023 · 2 comments

Comments

@mhoeher
Copy link
Contributor

mhoeher commented Aug 16, 2023

Hi everyone,

not sure if this is the right project to raise this issue against, but maybe you've at least some ideas. I'll also raise an issue against libsecret (as I suspect this also might have a bug). Anyway, what's the problem?

In my app OpenTodoList I'm using qtkeychain to store account passwords safely. This generally works fine, with one exception:

I also distribute the app via Flatpak. Sometimes/on some platforms, loading the secrets at app startup fails. For your reference, this is the code that I use to load previously stored secrets: https://gitlab.com/rpdev/opentodolist/-/blob/development/lib/utils/keystore.cpp?ref_type=heads#L272

What I observed is, that the finished() signal of the load job is never emitted. As you can see towards the end of the code, I already applied some workarounds (for me, this whole thing somehow smells like a race condition when the app is started). Back then when I applied it, it seemed to improve the situation a lot, but a user just reported exactly the same issue these days (https://gitlab.com/rpdev/opentodolist/-/issues/635).

Some further observations:

  • If I'm not mistaken, then other actions do work. For example, when the app fails to load its secrets, the user still can enter them again. It seems that they are then properly saved.
  • Some time back I already tried to workaround this by applying a timeout and - when it passed - retry the load. However, that didn't work (it's like the previous load call still "hangs" in libsecret).

I'd be happy about any kind of advice/tips/workarounds here. Please also let me know if you need further input from my side - I might be able to provide some debug information if you tell me what you'd need to better understand the issue.

Thanks a lot in advance!

@mhoeher
Copy link
Contributor Author

mhoeher commented Aug 20, 2023

Hey, it's me again!

I meanwhile found the cause of the issue - or, at least I am somewhat sure that it is in libsecret and not qtkeychain.

In my project, I downgraded to libsecret v0.19.1 and it seems this has fixed the issue!

Not sure though what you'd like to do with this ticket? Feel free to close it, but maybe it might be good to keep it open in case someone else stumbles across the same issue?

@TheOneRing
Copy link
Contributor

We experienced hanging credential jobs too without the involvement of flatpack.
owncloud/client#11290

It might also hang indefinitely if the system keychain is not yet properly setup/does not exist yet. (fresh install)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants