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: Local cache mutation build error in Swift 6 #417

Merged
merged 7 commits into from
Jul 11, 2024

Conversation

calvincestari
Copy link
Member

@calvincestari calvincestari commented Jul 5, 2024

Closes apollographql/apollo-ios#3398. Gets Xcode 16 successfully building local cache mutations.

  • I've opted to simply remove the fragment mutation setter and associated @available attribute. There is no functional change to the code because the setter was unable to be called anyways. So the only real loss is the convenience message displayed to the user if they did try to mutate the entire fragment instead of properties on the fragment. We could state this explicitly in the local cache mutation documentation if we think that would be helpful instead.
  • I also removed the "CI Tests (Xcode 16.0 Beta)" action that I added for us to manually run our CI suite on Xcode 16.0 beta. This was not as useful as I initially thought because it's catching all the concurrency (Sendable) related issues too which we know are a much more complex problem to resolve. This is back but with a reduced test suite that ensures the project can build and run unit tests (not codegen test configuration tests though) with Xcode 16.

I suggest we continue to monitor the Xcode 16 beta releases and if this turns out to be a beta glitch then we can revert this PR to get back the setter with attribute and users will get the nice warning message again if they try mutate the entire fragment.

Copy link

netlify bot commented Jul 5, 2024

Deploy Preview for apollo-ios-docc canceled.

Name Link
🔨 Latest commit ed6b71c
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docc/deploys/668f21415d87ac0008a23a7c

Copy link

netlify bot commented Jul 5, 2024

Deploy Preview for eclectic-pie-88a2ba canceled.

Name Link
🔨 Latest commit ed6b71c
🔍 Latest deploy log https://app.netlify.com/sites/eclectic-pie-88a2ba/deploys/668f2141b0eef900080fb2c1

@calvincestari calvincestari marked this pull request as ready for review July 5, 2024 05:16
Copy link
Member

@BobaFetters BobaFetters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good interim solution to me to get past this issue for Xcode 16 beta builds, agree we should continue to monitor the beta builds to see if this is just a bug in the current beta and can maybe be reverted in the future.

@calvincestari
Copy link
Member Author

Thanks @BobaFetters. Let's get @AnthonyMDev's opinion too before merging.

@AnthonyMDev
Copy link
Contributor

If this compiles and builds now, I'm good with merging it! When I initially did this work, I don't believe it was possible to include a _modify accessor without also including a set accessor (though maybe I just assumed that and didn't try?).

@calvincestari calvincestari marked this pull request as draft July 10, 2024 22:56
@calvincestari calvincestari marked this pull request as ready for review July 11, 2024 00:15
@calvincestari
Copy link
Member Author

If this compiles and builds now, I'm good with merging it! When I initially did this work, I don't believe it was possible to include a _modify accessor without also including a set accessor (though maybe I just assumed that and didn't try?).

Yes, this builds with both Xcode 15.4 and Xcode 16 without the setter.

@calvincestari calvincestari merged commit 5900428 into main Jul 11, 2024
34 checks passed
@calvincestari calvincestari deleted the fix/swift-6-modify-setter branch July 11, 2024 00:20
BobaFetters pushed a commit to apollographql/apollo-ios that referenced this pull request Jul 11, 2024
BobaFetters pushed a commit to apollographql/apollo-ios-codegen that referenced this pull request Jul 11, 2024
BobaFetters pushed a commit that referenced this pull request Jul 11, 2024
9b87ee08 fix: Local cache mutation build error in Swift 6 (#417)

git-subtree-dir: apollo-ios
git-subtree-split: 9b87ee082dfefa4036ce189fdeb5e52b3f952bef
BobaFetters pushed a commit that referenced this pull request Jul 11, 2024
…n Swift 6

git-subtree-dir: apollo-ios
git-subtree-mainline: 3497c4a
git-subtree-split: 9b87ee082dfefa4036ce189fdeb5e52b3f952bef
BobaFetters pushed a commit that referenced this pull request Jul 11, 2024
fb192097 fix: Local cache mutation build error in Swift 6 (#417)

git-subtree-dir: apollo-ios-codegen
git-subtree-split: fb1920971dea2158458bd2b1896653edbf934594
BobaFetters pushed a commit that referenced this pull request Jul 11, 2024
… error in Swift 6

git-subtree-dir: apollo-ios-codegen
git-subtree-mainline: 571b2ca
git-subtree-split: fb1920971dea2158458bd2b1896653edbf934594
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.

[Xcode 16] Mutating property of a fragment causes compile time error
3 participants