Aerial: Weather info function not working on macOS High Sierra
The weather info function is not working when Aerial (1.9.1) is activated but yet works fine when I run the test to check function. I’ve got the latest beta update (set for daily updates) so, I’m kind of stymied. Also, if I choose to manually specify my location, it won’t allow me to insert my location manually as was indicated in issue #1008. It maintains the default of Paris, FR. System is as follows:
iMac (27-inch, Late 2009) MacOS High Sierra (version 10.13.6) 2.8 GHz Intel Core i7 32 GB 1067 MHz DDR3 2TB SSD Graphics card: ATI Radeon HD 4850 512MB
General troubleshooting tips
Before logging an issue please check that:
- You have the latest version installed (There may be a beta version that fixes your issue), see here for the latest releases and bug fixes: https://github.com/JohnCoates/Aerial/releases
- Your issue isn’t already mentioned in our issues. You may find a workaround there or a similar request already made.
- Your problem isn’t mentioned in the troubleshooting page.
If none of this fixes your issue, tell us about the problem you are experiencing or the feature you’d like to request.
Required information
In order to help us sort your issue, we ask that you provide the following information:
- Mac model:
- macOS version:
- Monitor setup:
If appropriate, please enable Debug mode and Log to disk in Advanced tab and replicate your bug, then attach the AerialLog.txt file (You can access this file through the Advanced tab).
Description of issue / Feature request
{{Replace this}}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 37
@stevenbuccini arg ! Since I couldn’t test it myself I put the build in my other repo, thinking I’d put it here too when the bug was confirmed fixed but I completely forgot afterwards 🙈
It’s up now, thanks for reminding me !
Make sure you restarted System Preferences after installing 1.9.2, that could explain the tiny preview thing. Updating Swift screensavers is still a mess to this day.
I’ve noticed from time to time that the Yahoo Weather API doesn’t respond, it’s pretty rare but that happens too, so if you don’t see weather once in a while, it could be that too.
Awesome !
Well, it only worked on macOS 14 or above as I put a couple of lines of codes at the wrong place. If you want the technical explanation, the bug is exactly here :
https://github.com/JohnCoates/Aerial/blob/c285125b5509a3c2fde4b81dc89936ec29c6c261/Aerial/Source/Models/Locations.swift#L45
When you want to request the location on modern macOS, you have to call
locationManager.requestLocation(), but that’s only available in macOS 10.14+. The problem was, the two lines above. Because if you don’t have 10.14, macOS will just start giving you location, no question asked (and keep doing it). So in that case, macOS gave me the location, but since those two lines were missing, the code was never calling back the success callback, which was used in the chain to get to the next step (calling Yahoo’s API).That explains why it basically never called Yahoo’s API. Now you might be curious, how come the preview worked ?
Well, first, you were pretty unlucky because it sent me through the wrong path of thinking ! The tiny preview that didn’t work asked for the location, which macOS gave. But because of the issue above, it never called the Yahoo API so it didn’t display anything in that tiny window. But ! When you launched the full screen preview, Aerial had actually cached the location received earlier by the tiny preview. And because it reused that (trying not to ask your location too often), that full screen preview worked (Aerial knew your location, and used it to call Yahoo’s API directly).
It’s really a stupid bug in the end, I misremembered how location services worked prior to 10.14 when writing the weather thing and there you go 😉