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

[BUGFIX] replace return of wrong error variable #3015

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

Denis-Kuso
Copy link
Contributor

This fixes the issue #3012 where the error returned by the Notify() call would incorrectly return a nil value (from dbus.SessionBus()), instead of the correct non-nil value (from call.Err).

This fixes the issue gopasspw#3012 where the error returned by the `Notify()`
call would incorrectly return a nil value (from `dbus.SessionBus()`),
instead of the correct non-nil value (from `call.Err`).

Signed-off-by: Denis-Kuso <[email protected]>
@Denis-Kuso
Copy link
Contributor Author

I noticed that errors returned by the Notify function are ignored throughout
the codebase, perhaps indicating that notification failures aren’t considered
critical. Given this, I didn't add tests for the obj.Call error path,
as it doesn't seem necessary (nor is it currently tested) to propagate the
error or affect the application's flow. Let me know if you'd prefer otherwise.

Copy link
Member

@dominikschulz dominikschulz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@dominikschulz
Copy link
Member

dominikschulz commented Dec 23, 2024

I noticed that errors returned by the Notify function are ignored throughout the codebase, perhaps indicating that notification failures aren’t considered critical. Given this, I didn't add tests for the obj.Call error path, as it doesn't seem necessary (nor is it currently tested) to propagate the error or affect the application's flow. Let me know if you'd prefer otherwise.

Correct choice. For most instances I don't consider the returned errors from this method important since notifications are mostly best effort anyway. But I still think it's important that the method correctly returns errors - if any - so the callers can decide if and how to handle them.

@dominikschulz dominikschulz merged commit 05a6743 into gopasspw:master Dec 23, 2024
8 checks passed
@Denis-Kuso Denis-Kuso deleted the change-return-variable branch December 26, 2024 15:05
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.

2 participants