keepassxreboot / keepassxc-browser

KeePassXC Browser Extension
GNU General Public License v3.0
1.72k stars 176 forks source link

KeePass XC Firefox extension causes delay when quitting Firefox #1644

Open sindastra opened 2 years ago

sindastra commented 2 years ago

Expected Behavior

Firefox should quit "instantly" just as it does without the extension enabled.

Current Behavior

I measured a delay of about 7 seconds when quitting Firefox with the KeePass XC extension enabled (meaning, until the process actually terminates).

Possible Solution

Removing or disabling the KeePass XC extension solves the problem (not a desired solution).

Steps to Reproduce (for bugs)

  1. Install Firefox on macOS 11 (arm64)
  2. Quit Firefox and measure time to process termination
  3. Install KeePass XC Browser Extension
  4. Quit Firefox and measure time to process termination and compare
  5. There should be a significant delay with the KeePass XC Browser Extension enabled

Additional info: The database is set up and connected on my end. It does not matter if KeePass XC (the application) itself is running or not, the delay is there either way as long as the browser extension is enabled.

Debug info

KeePassXC - 2.7.1 KeePassXC-Browser - 1.7.12 Operating system: macOS 11 (arm64) Browser: Mozilla Firefox 101.0.1

varjolintu commented 2 years ago

Does the same happen with a new temporary Firefox profile? For me Firefox shuts down immediately. Although I'm not on ARM.

sindastra commented 2 years ago

@varjolintu I did create a new profile using the Firefox profile manager. I then installed the KeePass XC extension, and did not connect with the database. Same issue. After disabling the extension, it did again quit instantly. So, I can confirm that yes, the issue happens again in a new profile.

varjolintu commented 2 years ago

Can you check the keepassxc-proxy process from Activity Monitor? Is that process staying open or does it close before the delay?

sindastra commented 2 years ago

@varjolintu When I choose "Quit", keepassxc-proxy remains open during the delay. It quits together with Firefox after the delay.

varjolintu commented 2 years ago

Can you check by debugging the background script background/keepass.js inside the function onDisconnected() that it actually hits there? You can debug the script from about:debugging#/runtime/this-firefox and choose Inspect for KeePassXC-Browser. Then hit the line number 1073:

Screenshot 2022-06-10 at 16 06 46

I'm curious if the delay happens before or after this callback.

sindastra commented 2 years ago

@varjolintu The problem is, I can't debug a quit because it will close that window (the visible parts disappear instantly, even though the process remains). Unless you know of a way to set a "breakpoint" so that it will prevent the quit, or something of that sorts. If clicking the line itself is setting a breakpoint, then I guess it didn't hit because it quit?

However, I do have another piece of information for you that might be of use: In the Activity Monitor, I did force-quit keepassxc-proxy, and after that process terminated, I did quit Firefox, and it did quit instantly. So, it seems like it's keepassxc-proxy that's hanging and causing a delay in some form.

varjolintu commented 2 years ago

Cannot reproduce this even with M1 Mac.

sahneschnitte commented 2 years ago

got the same problem, i had it also before switching to ARMed Mac. and when disabling keypassxc extension FF quit quickly. can it be related to a changed session.restore.interval parameter ?

sindastra commented 1 year ago

I just wanted to add that I upgraded from macOS 11 to 12 and the issue persists (in case that's useful to know).

varjolintu commented 1 year ago

Still haven't seen this even once.

varjolintu commented 1 year ago

Two other computers with the latest macOS Ventura does not have this issue either.