At 1:18 PM a bug report landed for Southbound, my iOS app that counts your Florida days for tax residency. A user had flown to Illinois, used the app there just fine, come home to Florida, and now it “won’t open at all.”
First production incident. One user, total crash, zero clue. Great start to the afternoon.
Midnight moves with the phone
The root cause turned out to be midnight. Southbound keys each day’s record by Calendar.startOfDay, which quietly depends on whatever timezone the phone is in. Midnight in Florida is 4:00 UTC. Midnight in Illinois is 5:00 UTC. On a travel day, the exact-match lookup misses the record created in the other timezone and happily writes a second record for the same calendar day.
Two records, one crash
Two records, same day. Now the fun part: the code that builds the month view indexed those records with Swift’s Dictionary(uniqueKeysWithValues:), which doesn’t return nil or throw on a duplicate key. It crashes the entire app. And here’s the twist that made it hunt-worthy: viewed from Central time, the two records land on different day numbers, so no collision — the app “worked fine” in Illinois. Viewed from Eastern time they collide. The month view is on the first tab, so back in Florida the app crashed on every single launch.
The truly annoying detail: two sibling methods in the same file already deduplicated records per day, because someone (me) had figured this exact thing out before. The month view was the one call site that got missed.
By 2:30 I had a minimal repro trapping with Fatal error: Duplicate values for key: '23', a dedup fix, and a green regression test. Upload the patch, done by 3:00, right?
Apple’s two tollbooths
No. Apple had updated the developer license agreement at WWDC and I’d never accepted it, so the upload bounced. Accepted, re-uploaded. Then App Review rejected the build for an invalid privacy manifest: I’d written NSPrivacyAccessedAPIReasons where Apple wants NSPrivacyAccessedAPITypeReasons. That typo had been sitting in the project since build 15 — it never got caught because build 15 never actually bundled the file, so this was the first time Apple ever looked at it. A passing App Review, it turns out, is not proof your privacy manifest is valid.
Fixed the key, built again, resubmitted at 4:22 PM with an expedited review request. Report to resubmission: three hours and four minutes, two of Apple’s tollbooths included.
Never key days by timezone
The lesson I actually wrote down: Dictionary(uniqueKeysWithValues:) is a crash waiting for real-world data, and timezone-relative date keys are a spectacular choice for an app whose entire job is knowing which state you were in on a given day. The hardening pass that makes duplicates impossible to create at all shipped to a branch the same night — because every snowbird who splits time across Central or Mountain time was one flight away from the same crash.