Skip to content

Conversation

@hiranya911
Copy link
Contributor

  • Implemented WebpushConfig and WebpushNotification types
  • Removed an unused extension method (IEnumerable.Copy())
  • Made some internal properties private for better encapsulation

/// The direction in which to display the notification.
/// </summary>
[JsonIgnore]
public Direction? Direction { get; set; }

Choose a reason for hiding this comment

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

I'm wondering why you have a set of nullable properties for types like this? Why not use default values instead? To me it seems like a pain to deal with the nullability of e.g bool properties rather than just reading the default value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to make sure those parameters get dropped from the JSON output. For most parameters, we want to avoid sending a default value to the backend (0 for ints, false for bools etc) when they are not set by the user.

Choose a reason for hiding this comment

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

It does worry me a little that we're letting optimizations leak into the API surface. I guess if that's the way you do it across the board it's ok to me.

Copy link

@bklimt bklimt left a comment

Choose a reason for hiding this comment

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

LGTM. I'll leave the review to Stewart.

@hiranya911 hiranya911 merged commit 70efb05 into hkj-fcm Jan 22, 2019
@hiranya911 hiranya911 deleted the hkj-fcm-part3 branch January 22, 2019 22:50
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.

3 participants