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

Add nullability annotations to public API #106

Merged
merged 2 commits into from Jan 22, 2018

Conversation

nolanw
Copy link
Contributor

@nolanw nolanw commented Jan 12, 2018

As mentioned in #105.

Nullability annotations were introduced in Xcode 6.3 (which included iOS 8.3). I'm not sure what the minimum supported Xcode version is in these parts, but if 6.3 is a reasonable minimum then we shouldn't need any #define NS_ASSUME_NONNULL_BEGIN etc. to pacify older versions of the dev tools. Let me know if I've guessed wrong here.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@nolanw
Copy link
Contributor Author

nolanw commented Jan 12, 2018

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

Copy link
Contributor

@morganchen12 morganchen12 left a comment

Choose a reason for hiding this comment

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

LGTM

@morganchen12
Copy link
Contributor

@mcdonamp please merge when you get a moment

Copy link
Contributor

@asciimike asciimike left a comment

Choose a reason for hiding this comment

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

Two public API changes

@@ -70,7 +72,7 @@ typedef void (^GFCallbackBlock) (CLLocation *location, NSError *error);
* @param location The location as a geographic coordinate
* @param key The key for which this location is saved
*/
- (void)setLocation:(CLLocation *)location
- (void)setLocation:(nullable CLLocation *)location
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want this nullable as nil is not a valid location.

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the internal API setLocationValue:forKey:withBlock: (https://github.com/firebase/geofire-objc/blob/master/GeoFire/Implementation/GeoFire.m#L84) allows location to be nil (when we delete things), but the public API probably shouldn't allow this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yep, I was basing it off the internal API.

@@ -80,9 +82,9 @@ typedef void (^GFCallbackBlock) (CLLocation *location, NSError *error);
* @param key The key for which this location is saved
* @param block The completion block that is called once the location was successfully updated on the server
*/
- (void)setLocation:(CLLocation *)location
- (void)setLocation:(nullable CLLocation *)location
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above, probably not nullable.

@asciimike
Copy link
Contributor

@nolanw, @morganchen12 Sorry about the delay. One minor change on the public surface; otherwise, LGTM. Thanks for doing this!

@nolanw
Copy link
Contributor Author

nolanw commented Jan 22, 2018

Not nullable it is!

@asciimike
Copy link
Contributor

LGTM

@asciimike asciimike merged commit 8d276e4 into firebase:master Jan 22, 2018
@asciimike
Copy link
Contributor

asciimike commented Jan 22, 2018

@morganchen12, do you have permissions to release, or do you need me to?

@morganchen12
Copy link
Contributor

I don't have release permissions, so please make a new release when you have the time.

Thanks!

@asciimike
Copy link
Contributor

Published in v2.0.1.

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.

None yet

4 participants