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

Fix locking database when password generator is triggered from browser extension #9821

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

varjolintu
Copy link
Member

When the password generator popup has been triggered from browser extension, database lock signal is not handled.

Fixes #9820

Testing strategy

Manually.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@@ -506,6 +506,8 @@ void BrowserService::showPasswordGenerator(const KeyPairMessage& keyPairMessage)
if (!m_passwordGenerator) {
m_passwordGenerator.reset(PasswordGeneratorWidget::popupGenerator(m_currentDatabaseWidget));

connect(m_currentDatabaseWidget, SIGNAL(databaseLockRequested()), m_passwordGenerator.data(), SIGNAL(closed()));
Copy link
Member

Choose a reason for hiding this comment

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

This works but it should really call a slot like hide or reject.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there even those slots in that class? Everything just signals closed().

Copy link
Member

Choose a reason for hiding this comment

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

Generally, you never want to rely on the fact that a signal is listened to. We happen to listen to it internally to the password generator, but that's not necessarily the case. If you call the hide slot it should emit the closed signal which then executes the rest of the sequence.

Copy link
Member Author

@varjolintu varjolintu Sep 3, 2023

Choose a reason for hiding this comment

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

This is best to done to the other PR. We'll have to make sure the m_passwordGeneratorRequested is set to false if we use hide() and the pointer is destroyed. Just changing the SIGNAL(closed()) to SLOT(hide()) here does not work. This was the reason I just called closed(). hide() does not seem to call it afterwards (same with reject()).

Copy link
Member

Choose a reason for hiding this comment

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

Yah that was part of the fixes in the other PR.

@droidmonkey
Copy link
Member

Might as well roll this fix into my pr to fix the dialog behavior

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

Successfully merging this pull request may close these issues.

Database doesn't lock when browser invoked password generator is open
2 participants