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

Workaround for incorrect DBus activation #34

Merged
merged 2 commits into from
Sep 23, 2024
Merged

Conversation

fmoessbauer
Copy link
Member

The broker implements DBus activation. However, it appears on the bus before it can fully be used (i.e. before the /com/microsoft/identity/broker1 becomes visible). By that, the buffered API calls are dispatched too early and return with an UnknownObject
error. This affects both the introspection and API calls.

To work around this, we poll for the path to show up before performing any other broker communication. Once the broker disappears, we clear our internal state to ensure the polling happens again before the next invocation.

Closes: #33

The broker implements DBus activation. However, it appears on the bus
before it can fully be used (i.e. before the
/com/microsoft/identity/broker1 becomes visible). By that, the buffered
API calls are dispatched too early and return with an UnknownObject
error. This affects both the introspection and API calls.

To work around this, we poll for the path to show up before performing
any other broker communication. Once the broker disappears, we clear our
internal state to ensure the polling happens again before the next
invocation.

This logic makes it possible to run the broker only when needed and also
solves issues around the initial startup of the broker via the web
extension.

Signed-off-by: Felix Moessbauer <[email protected]>
Previously, we precisely tracked the broker state and logged the user
out in case the broker disappeared. This however made it impossible to
auto-disable the broker after some time and only re-enable it when
needed again.

Now, we keep the user logged in once the frontend communicated once with
the broker. When needed again, we just call into the backend and let it
handle the startup, waiting and errors.

Signed-off-by: Felix Moessbauer <[email protected]>
@fmoessbauer fmoessbauer self-assigned this Sep 19, 2024
@jan-kiszka
Copy link
Collaborator

Looks good in general, just a clarification if the poll rate is reasonable should be done.

@fmoessbauer fmoessbauer merged commit 04c06aa into main Sep 23, 2024
3 checks passed
@fmoessbauer fmoessbauer deleted the fm/robust-startup branch September 23, 2024 10:49
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

Successfully merging this pull request may close these issues.

Feature request: start broker on-demand during operation
2 participants