sfsam / Itsycal

Itsycal is a tiny calendar for your Mac's menu bar. http://www.mowglii.com/itsycal
MIT License
3.25k stars 234 forks source link

Fixing bug introduced in Ventura 13.0B2 #208

Open rob-c opened 1 year ago

rob-c commented 1 year ago

Firstly, thanks for the amazing project! 😃

This is the minimal change I've needed to get Itsycal working on Ventura 13.0B2

Without this Itsycal.app is crashing on startup when there are microsoft or google calendars setup on MacOS. (The calendar.source.title object was defined as nil for non MacOS calendars which caused a crash on line 204 within a worker thread)

Not sure exactly if this is a bug/feature/change in MacOS so don't know if there is a better fix, this was just reaching for the smallest change needed.

sfsam commented 1 year ago

I appreciate this and I'm glad it's working for you now. I don't think I can merge it as-is because, while it may work on Ventura, it looks like it would break Itsycal on all previous versions of macOS. I'm going to have to do more research. Thanks to you, I now know that Apple has made numerous changes to EventKit under the hood. Unfortunately, my 2015 MacBook Pro cannot run Ventura so I don't yet know how I'm going to square this circle.

rob-c commented 1 year ago

Ah, OK there's a spare pre-Ventura box in my office I'll give it a spin on once I'm back from my summer break and I can test a fix that works for both there, (would just take an if nil check I suspect)

sfsam commented 1 year ago

I found an Apple EventKit engineer on Twitter and asked about the issue you found: https://twitter.com/TheRealAdamKemp/status/1561706198130249728?s=20&t=uhJenq0isc1zZ4zsL9IyCg

Screen Shot 2022-08-22 at 11 56 45 AM

I believe Ventura has a feedback app where you can report bugs. When you submit, it should give you a feedback number. Could you submit this bug per the tweet above and tell me the feedback number so I can forward it to the engineer?

As for the fix, while it prevents the crash, I don't think I can use it because calendar.source.title and calendar.title are two completely different things. They aren't interchangeable. It sounds like the behavior you found is a bug in Ventura (they have made extensive changes) and needs to be fixed by Apple so calendar.source.title doesn't return nil.

rob-c commented 1 year ago

OK, I've submitted feedback via the apple tool and have the ID: FB11363949 which I attached the crash from Itsycal 13.3 to.

sfsam commented 1 year ago

Thank you! I have forwarded the feedback number to the Apple dev. FWIW, I have since learned from a couple users that they are running Itsycal successfully on Ventura. I think those people do not have Google or Microsoft calendars. Are those the only calendars where the source title is nil? Are the Apple calendars ok for you?

sfsam commented 1 year ago

The Apple dev responded: https://twitter.com/TheRealAdamKemp/status/1562662568992206848

Screen Shot 2022-08-24 at 9 53 56 PM

Here are instructions for triggering sysdiagnose: sysdiagnose_Logging_Instructions.pdf

(The original PDF is from this URL: https://download.developer.apple.com/OS_X/OS_X_Logs/sysdiagnose_Logging_Instructions.pdf)

I realize submitting feedback to Apple is a bit of a pain so I really appreciate you helping me with this. 🙏

rob-c commented 1 year ago

Thank you! I have forwarded the feedback number to the Apple dev. FWIW, I have since learned from a couple users that they are running Itsycal successfully on Ventura. I think those people do not have Google or Microsoft calendars. Are those the only calendars where the source title is nil? Are the Apple calendars ok for you?

In the apple ticket this only seems to impact Exchange and google calendars, and removing and re-adding the calendars didn't fix the problem. I've not got a spare machine to attempt a full re-install from scratch with the beta to see if it's related to some db corruption during an update (wouldn't be the first time in recent updates). Apple calendars just worked as expected. The whole reason I love Itsycal is that unfortunately I have to work with 2 different groups using different calendar systems and need to ingest that to keep on top of things.

I'll try to put together a sysdiagnose from a Ventura install in the office in a week or 2 but unfortunately I'm a little pressed for time atm.

I'm not happy sharing with apple a bunch very low level of machine specs, exactly how I'm using my equipment, and a full breakdown of everything my wifi antenna sees at home (and the rest). This information is almost guaranteed to be unrelated. I can understand why that data would be helpful in diagnosing hardware/lockup problems, so don't think it's entirely in-appropriate for them as a system builder to collect it, but for debugging an issue introduced into their 3rd party API I am not comfortable sharing this level of PII without a very good reason, especially when I occasionally manage the PII of others using this system.

(Feel free to share this opinion with Apple if you think it would help, but I suspect they're box ticking and won't proceed until they get a bunch of unrelated information they don't need to allow them to collect heuristics)

I would have thought a full description of how to re-create the problem tested on 2 macbooks (had a friend chime in), an application crashdump, a workaround for the crash, and effectively an example piece of code for how to demonstrate the problem would have been enough for Apple, but apparently not 😛

sfsam commented 1 year ago

If you can eventually replicate the bug on a non-personal work machine and submit a sysdiagnose, great. If not, I completely understand. I don't understand why they'd need so much info for this issue either. Thank you for your help.

jacobweberbowery commented 1 year ago

For what it's worth, the release version of itsycal is working for me in the released version of Ventura with a Google account.

sfsam commented 1 year ago

@jacobweberbowery That's great to hear. Thanks for the info!

francesco-grani commented 1 year ago

Hi, I stumbled upon the message on the homepage that itsycal is not compatible with Ventura and then landed on this post.

I just wanted to also report that I have currently no issues with Ventura (macOS 13.0 (22A380)) + itsycal + Google Calendar.

(PS: thanks for the great app!)

Semkoo commented 1 year ago

Hi, I stumbled upon the message on the homepage that itsycal is not compatible with Ventura and then landed on this post.

I just wanted to also report that I have currently no issues with Ventura (macOS 13.0 (22A380)) + itsycal + Google Calendar.

(PS: thanks for the great app!)

I am having an issue and its not loading for me

OS: Version 13.0 (22A380)

sfsam commented 1 year ago

@Semkoo Can you try this: https://www.mowglii.com/2022/11/05/ventura.html

Semkoo commented 1 year ago

@Semkoo Can you try this: https://www.mowglii.com/2022/11/05/ventura.html

image

Uncheck Calendar did the trick so yes it worked

But when checking it back its not loading the events

image

sfsam commented 1 year ago

@rob-c I'm wondering if you can still replicate this issue. If so, can you tell me if in the cases where calendar.source.title is nil, is calendar.source.sourceIdentifier a valid, non-nil NSString? As a workaround, I'm thinking about substituting calendar.source.sourceIdentifier for calendar.source.title in the cases where Ventura is returning nil for the latter.

nk9 commented 7 months ago

Any chance that Sonoma has addressed this problem? I'm using Itsycal fine on macOS 14, however I don't seem to have any System Prefs-level Internet Accounts, so I guess I wouldn't have seen the problem.