Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: Add new new push notification interface ParseNotification for managing push notifications #949

Merged
merged 19 commits into from
Aug 6, 2023

Conversation

mbfakourii
Copy link
Member

@mbfakourii mbfakourii commented Jul 3, 2023

Pull Request

Issue

Closes: #936

Approach

In the new method, ParseNotification should be given to ParsePush

ParsePush.instance.initialize(
  firebaseMessaging,
  parseNotification: ParseNotification(onShowNotification: (value) {
    // show notification
  }),
);

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title fix: remove flutter_local_notifications and creating a new method for ParseNotification fix: Remove flutter_local_notifications and creating a new method for ParseNotification Jul 3, 2023
@parse-github-assistant
Copy link

Thanks for opening this pull request!

@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.27% 🎉

Comparison is base (aefc84e) 39.33% compared to head (b6146ec) 39.60%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #949      +/-   ##
==========================================
+ Coverage   39.33%   39.60%   +0.27%     
==========================================
  Files          60       60              
  Lines        3356     3333      -23     
==========================================
  Hits         1320     1320              
+ Misses       2036     2013      -23     
Files Changed Coverage Δ
packages/flutter/lib/parse_server_sdk_flutter.dart 20.00% <ø> (ø)
...utter/lib/src/notification/parse_notification.dart 0.00% <0.00%> (ø)
packages/flutter/lib/src/push/parse_push.dart 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mbfakourii mbfakourii requested a review from a team July 6, 2023 11:06
@mtrezza
Copy link
Member

mtrezza commented Jul 10, 2023

@cool2apps Could you test this PR out, if it works for you?

@mbfakourii
Copy link
Member Author

@cool2apps Could you test this PR out, if it works for you?

I think it is ready for merge, it is no longer dependent on another library

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Could you please change the PR title? It currently seems to describe the change, but it should describe the issue that is being fixed.

@mbfakourii mbfakourii changed the title fix: Remove flutter_local_notifications and creating a new method for ParseNotification fix: Update ParseNotification input for proper notification display Jul 21, 2023
@mbfakourii
Copy link
Member Author

mbfakourii commented Jul 21, 2023

Could you please change the PR title? It currently seems to describe the change, but it should describe the issue that is being fixed.

I changed it, I hope it's good, I didn't have a better idea for the title

@mtrezza
Copy link
Member

mtrezza commented Jul 21, 2023

The PR title must describe the issue, the solution of how it was fixed is an option addition. It's still not clear what this PR fixes. If it'S not "properly" displaying notifications, could we specify what that means? Or is it something else?

@mbfakourii mbfakourii changed the title fix: Update ParseNotification input for proper notification display fix: Use a new user interface for managing notifications Jul 22, 2023
@mbfakourii
Copy link
Member Author

The PR title must describe the issue, the solution of how it was fixed is an option addition. It's still not clear what this PR fixes. If it'S not "properly" displaying notifications, could we specify what that means? Or is it something else?

I changed it, what do you think?

@mtrezza
Copy link
Member

mtrezza commented Jul 22, 2023

Again, this describes the change, not the issue that this PR fixes.

  • Is this PR fixing a bug, then what does it fix?
  • Is the PR adding a new or changing an existing feature and not fixing a bug, then what is that feature?

@mbfakourii
Copy link
Member Author

Again, this describes the change, not the issue that this PR fixes.

  • Is this PR fixing a bug, then what does it fix?
  • Is the PR adding a new or changing an existing feature and not fixing a bug, then what is that feature?

In this PR, we solved the problem of using the notification library overhead by removing it and replacing it with an interface.
I think this PR solves a bug

@mtrezza
Copy link
Member

mtrezza commented Jul 24, 2023

If it was a bug we should be able to describe what's broken or not working, but that seems not possible. If it removes a overhead then maybe it's a performance improvement?

How about:

perf: Remove push notification library overhead by replacing it with a push notification interface

Just to confirm again, this PR does not require any changes in a developer's app code, right?

@mbfakourii mbfakourii added the state:breaking Breaking change requires major version increment and `BREAKING CHANGE` commit message label Jul 25, 2023
@mbfakourii
Copy link
Member Author

mbfakourii commented Jul 25, 2023

If it was a bug we should be able to describe what's broken or not working, but that seems not possible. If it removes a overhead then maybe it's a performance improvement?

How about:

perf: Remove push notification library overhead by replacing it with a push notification interface

Just to confirm again, this PR does not require any changes in a developer's app code, right?

Changes are required on the developer side.
I think this is a breaking changes

but since ParsePush is a new feature and this change is very small, I'm not sure there is a need for a MAJOR version increase.

@mtrezza
Copy link
Member

mtrezza commented Jul 25, 2023

We do not distinguish between "small" and "large" breaking changes. Any breaking change usually requires a major version increment, the exception being security fixes which are evaluated on a per-case basis.

but since ParsePush is a new feature

So then this is would be a feat PR that contains a breaking change. A feat is higher in priority than a perf change, but we can add the performance implication in the changelog entry.

Merging a breaking change as non-breaking in flutter is especially bad due to the de-facto standard of using range operators for dependency versions. That means they will auto-update and potentially break apps. We need to be extra careful because of that.

@mbfakourii
Copy link
Member Author

We do not distinguish between "small" and "large" breaking changes. Any breaking change usually requires a major version increment, the exception being security fixes which are evaluated on a per-case basis.

but since ParsePush is a new feature

So then this is would be a feat PR that contains a breaking change. A feat is higher in priority than a perf change, but we can add the performance implication in the changelog entry.

Merging a breaking change as non-breaking in flutter is especially bad due to the de-facto standard of using range operators for dependency versions. That means they will auto-update and potentially break apps. We need to be extra careful because of that.

I got it, so it is a breaking change and feat added in title

@mbfakourii mbfakourii changed the title fix: Use a new user interface for managing notifications feat: Use a new user interface for managing notifications Jul 28, 2023
@mtrezza
Copy link
Member

mtrezza commented Jul 28, 2023

I think the PR title could be improved; with "user interface" you are probably referring to the programming interface, not a UI.

How about this change log entry:

BREAKING CHANGES

  • The push notification library flutter_local_notifications is replaced with the new push notification interface ParseNotification (#949)

Features

  • Add new new push notification interface ParseNotification for managing push notifications (#949)

Feel free to add any info to the "breaking change" line that may help developers to cope with the braking change.

@mbfakourii mbfakourii changed the title feat: Use a new user interface for managing notifications feat: Add new new push notification interface ParseNotification for managing push notifications Jul 30, 2023
@mbfakourii
Copy link
Member Author

I think the PR title could be improved; with "user interface" you are probably referring to the programming interface, not a UI.

How about this change log entry:

BREAKING CHANGES

  • The push notification library flutter_local_notifications is replaced with the new push notification interface ParseNotification (#949)

Features

  • Add new new push notification interface ParseNotification for managing push notifications (#949)

Feel free to add any info to the "breaking change" line that may help developers to cope with the braking change.

I changed it, what do you think?

@mtrezza
Copy link
Member

mtrezza commented Jul 30, 2023

We would need a changelog entry as well

@mbfakourii
Copy link
Member Author

We would need a changelog entry as well

added

@mtrezza
Copy link
Member

mtrezza commented Aug 6, 2023

@mbfakourii I've edited the changelog; to better explain the format, when there's a breaking change, there is the BREAKING CHANGES section that can be more verbose and explain what is breaking, how the developer can transition and what to be careful about. Then there is still the Features section that has the shorter entry for the feature change. In other words, a PR always requires a base entry like Bug Fixes or Feature and if it's breaking it requires an additional entry in BREAKING CHANGES.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Looks good

@mtrezza mtrezza merged commit a2fb099 into parse-community:master Aug 6, 2023
@mbfakourii mbfakourii deleted the fix_notification branch October 3, 2023 14:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
state:breaking Breaking change requires major version increment and `BREAKING CHANGE` commit message
Projects
None yet
Development

Successfully merging this pull request may close these issues.

awesome_notifications causing problems with iOS
2 participants