Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DataDict subscript crash on iOS <= 14.4 #2784

Merged
merged 4 commits into from
Jan 19, 2023

Conversation

calvincestari
Copy link
Member

@calvincestari calvincestari commented Jan 18, 2023

Fixes #2668

It seems that additional type checking was added in Swift 5.4 (correlated with Xcode 12.5 and iOS 14.5) which handled the base type conversions/checks of AnyHashable for us. On iOS <= 14.4 accessing DataDict properties where the AnyHashable value is nil causes a crash. This change adds checks on the base type to prevent the crash.

I don't think there are any automated CI checks we can add to test this because of the CircleCI supported environments:

  • The 14.2.0 image, which we use only has the iOS 15.5 and 16.1 runtimes. We would need to download the simulator before being able to run any tests and that will drastically increase CI times.
  • The 12.5.1 image does have iOS runtimes that would work (13.7 and 14.5) but our code would not compile on the older versions of Xcode and Swift.

@netlify
Copy link

netlify bot commented Jan 18, 2023

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit 826966e
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/63c88e6666a4a10008c96889

@calvincestari calvincestari marked this pull request as ready for review January 18, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataDict subscript function crashes on iOS 14.4 and under
2 participants