-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fixed iOS push module compilation issue on some versions of XCode #373
Conversation
I think it might be worth us trying to reproduce #347, so we can have more confidence in our fix. The Can we try to get further information from the issue creators? Perhaps they could supply us with some sample code to reproduce the issue. |
I'm aware that the
I'm not very familiar with iOS development environment, but the issue seems to be device-specific and I failed to reproduce it on my machines, with XCode 12 and 13 😞 Since this is a compile-time problem, I don't think users will be able to support us with sample code - the problem lies within the Ably library, and users don't modify it on their side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have sympathy for @lawrence-forooghian's suggestion, however I'm also keen for us to get this fix in front of the user that reported it, as well as other users potentially.
Do we have any idea if there may be other areas of this codebase at risk of this particular Swift compiler issue?
Also, I think it would be really helpful for you to add some commentary to the code where you use the either nullable
prefix (as I suggest) or your Unwrapped
suffix to explain exactly why this 'dance' is being done.
The introduced fixes seem to solve the problem, confirmed by one of affected users here: #347 (comment) |
This seems to be an edge case for specific versions of development tools. I managed to get the issue only in a few specific configurations of XCode / MacOS / Flutter versions and it seems to be some sort of compiler issue. I think the fix should be enough to solve the case.
There isn't too much Swift code in the repository, it's mostly Objective C. I've checked and the problematic
I've left a comment with a short explanation and link to the issue in cf7b9cb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to approve if @QuintinWillison is keen to get this merged as-is 👍
This should solve #347. Apparently, for some combinations of Swift/XCode versions the compiler doesn't correctly recognize the
let guard
statements, which leads tohandle
andchannelName
being identified as nullable types, although they are guarded by specific checks before they are used. I've made a non-nullable, unwrapped versions of those variables to avoid those compilation errors.