keepassxc-browser icon indicating copy to clipboard operation
keepassxc-browser copied to clipboard

KeePass XC Firefox extension causes delay when quitting Firefox

Open sindastra opened this issue 2 years ago • 11 comments

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

sindastra avatar Jun 10 '22 11:06 sindastra

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

varjolintu avatar Jun 10 '22 11:06 varjolintu

@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.

sindastra avatar Jun 10 '22 11:06 sindastra

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

varjolintu avatar Jun 10 '22 12:06 varjolintu

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

sindastra avatar Jun 10 '22 13:06 sindastra

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.

varjolintu avatar Jun 10 '22 13:06 varjolintu

@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.

sindastra avatar Jun 10 '22 13:06 sindastra

Cannot reproduce this even with M1 Mac.

varjolintu avatar Jul 11 '22 08:07 varjolintu

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 ?

sahneschnitte avatar Jul 26 '22 09:07 sahneschnitte

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

sindastra avatar Sep 21 '22 18:09 sindastra

Still haven't seen this even once.

varjolintu avatar Sep 21 '22 18:09 varjolintu

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

varjolintu avatar Feb 21 '23 11:02 varjolintu