Post

During development I kept deleting and reinstalling the app. This caused a problem. @keepdates.app relies on its own calendar it kept creating a new one on each install and had no idea that a previous calendar was already created by it. 🤖 (1/3) #buildInPublic #swift #swiftUI #ios #iosDev #app

1 repost9 likes

Yes - I had the app create/look for a specific sentinel event (in the way distant future). If it exists, that’s the calendar it takes… otherwise it creates a new one.

I hit almost the same bug with EventKit. reinstalling nuked the local mapping, then I had duplicate calendars everywhere. did you stick with the sentinel event or find something less cursed?

I stuck with a sentinel event - not the nicest, but kinda works. You know, “if it’s stupid, but it works; then it’s not stupid” 😅 Not sure how to solve the issue of someone picking iCloud as the calendar source and then installing the app on two devices with a different set of contacts 😬

yeah that's the nasty version of it. once contacts differ per device, i'd stop treating them as identity and lean on a stable local UUID plus a repair path when iCloud brings back a mismatch. sentinel event still feels safer than silently merging the wrong people.

exactly! I think I’m being careful with it though- the app doesn’t touch any events that it isn’t 100% sure it created, and each event is tagged with a custom hash, so that, if it finds an existing calendar, it can still match matching contact dates to existing events. that should even handle iCloud

I mean, that was intentional - I didn't want it to just pick any calendar with the "correct" name. The likelihood of a user making a calendar with that name was low, but I didn't want to risk it. 😬 I needed a way to "fingerprint" the correct calendar, so that it could be found again. 🔍 (2/3)