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

WIP: Error check in push notification #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flaviobergamini
Copy link

Description

Error check in push notification in CreateNotificationWithHttpInfoAsync method in DefaultApi class to prevent false positive.

Details

When sending push notifications, the return is null, making it impossible to confirm the actual sending. The HTTP request made within OneSignal returns a false negative, the StatusCode of the request is 200, but there are errors within the payload. The error in question is invalid user ID but the user ID exists and the notification arrives.
We made a change, where we validate if there is an exception in the request and if the Status Code is different from OK, this works "correctly", not returning null, returning 200 but with an invalid user ID error.

Motivation

This PR is being opened to propose an error treatment in case the HTTP request made has a return other than 200, making it impossible to return null. Still, I believe the biggest problem is within the API, which I don't have access to contribute

Scope

Due to the invalid user ID error, even though there is a registration in the system, the project returns null, making it impossible to confirm that the push notification was sent effectively

Testing

Manual testing

I cloned the OneSignalAPI repository and did the imports locally, not depending on the NuGet import. This made it possible to perform a more effective debug and better understand what happened by detecting the effective and failed send scenarios by also using the mobile app to confirm receipt of push notifications and adding the StatusCode 200 check

Checklist

Overview

  • [X ] I have filled out all REQUIRED sections above
  • [X ] PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • [X ] Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • [X ] I have personally tested this on my device, or explained why that is not possible

Final pass

  • [X ] Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • [X ] I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

… CreateNotificationWithHttpInfoAsync method in DefaultApi class to prevent false positive.
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.

1 participant