quicksilver/Quicksilver — pull request #743 by skurfer (2012-03-01 15:41:54+00:00)
Title: prevent freeze when launching on login

I believe this fixes #580. If I’m right, it should also fix #617, #630, #675, #738, and #741. And if I’m wrong, 580 is already closed, so no harm. :-) I was going to wait to hear from a couple of users first, but the fact is I was able to reproduce this hanging behavior and this fixes it for at least one scenario, so I’m putting it out there.

I’d like to see this in B66 since it’s a very small change and it could solve an issue that (as you can see) has been reported over and over for several months.

### Background you can skip :-) ###

I was able to reproduce it by setting up B65 fresh, logging out, and logging in again. I verified that the same was not reproducible with B61. But then I noticed that after simply running B61 once, B65 no longer exhibited the issue either. So I ran `diff` on the preferences before and after B61 had run and the only difference was the presence of “Last Update Check”. Deleting that setting caused B65 to hang again (only on login).

There appears to be a race condition where if Quicksilver starts very very soon after a login, having the date `nil` confuses it. Later in a user’s session, it’s not a problem. That explains why it’s reported by users with SSDs. They’re the only ones capable of launching it fast enough to be in the problem window. That also explains why I couldn’t reproduce it in my main account, even though I’m on an SSD. I have that annoying 30 second delay (described in 580) before Quicksilver starts.

I’m not sure what exactly changed after B61 that caused this, but I think it may have been more aggressive about checking for updates, triggering the creation of that key in the preferences.

### Unrelated question I don’t have a good place for ###

I noticed [this call][window] while poking around.

[[self interfaceController] window];

It doesn’t get assigned to anything, so does it need to be there? Does it do anything? The documentation for the `window` method makes me think “no”.

[window]: /quicksilver/Quicksilver/blob/master/Quicksilver/Code-App/QSController.m#L1021