Atelier-Shiori / malupdaterosx-cocoa

Native MyAnimeList Scrobbler for macOS
https://malupdaterosx.moe/malupdaterosx/
BSD 3-Clause "New" or "Revised" License
24 stars 3 forks source link

Freeze when resolving login items for unavailable AFP shares #33

Closed swoolcock closed 7 years ago

swoolcock commented 7 years ago

I have a keychain item setup to automatically connect to my NAS on boot. My NAS was turned off, so the app got stuck trying to resolve it.

Freezes on the LSSharedFileListItemResolve call in [LoginItems itemRefInLoginItems]. Example log for my NAS (Jade) is:

2017-04-17 15:22:06.831228 MAL Updater OS X[1601:16455] afp_GetURLFromURLRemountInfo: address string is jade 2017-04-17 15:22:06.831242 MAL Updater OS X[1601:16455] NewAFPURL: returning realurl = :afp://;AUTH=No%20User%20Authent@jade/Music:

moyitpro commented 7 years ago

I changed the login item implementation to something else. Can you try this build and see if it has the same issues? malupdaterosx-2.3.3-test.zip

swoolcock commented 7 years ago

Nope, still seems to freeze. To test it, I'm unplugging my NAS and waiting for the connection to time out, then open the Preferences panel in MAL Updater. The fox icon stays depressed in the status bar, and the process has to be killed.

Edit: Adding these flags to LSSharedFileListItemResolve seems to fix it. kLSSharedFileListNoUserInteraction|kLSSharedFileListDoNotMountVolumes

moyitpro commented 7 years ago

I found out that LSSharedFileListItemResolve is deprecated. I replaced it with LSSharedFileListItemCopyResolvedURL. Try now. malupdaterosx-test2.zip

moyitpro commented 7 years ago

I forgot to add kLSSharedFileListNoUserInteraction|kLSSharedFileListDoNotMountVolumes, this should now work. malupdaterosx-test3.zip

swoolcock commented 7 years ago

Yep, that fixed it. Nice work. ;)