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

CRASH - When the launch url is invalide #1954

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MichaelOliveiraBx
Copy link

@MichaelOliveiraBx MichaelOliveiraBx commented Jan 5, 2024

Description

Catch an crash when the url is invalide and add an callback in case of this error happen

Details

Motivation

FIX this issue

Scope

When we start the destination activity more than JSONException we catch ActivityNotFoundException and we call the listener

Manual testing

Tested opening a notification with an invalide url , app build with Android Studio 2023.1.1 with our app (Omada) on a Pixel 5 with Android 13.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • 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
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • 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.
  • 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.

This change is Reviewable

@MichaelOliveiraBx
Copy link
Author

My bad I forget to add the setter for the listener, I have add it on the next commit.
I will squash after your review.

@jinliu9508
Copy link
Contributor

@MichaelOliveiraBx Thank you for reporting this and uploading your work! We are currently reviewing this issue. Out of curiosity, what plans do you have in mind for handling the event when an ActivityNotFoundException is thrown?

@MichaelOliveiraBx
Copy link
Author

MichaelOliveiraBx commented Jan 16, 2024

Your welcome! To be honest, log the stack trace of the exception will be enough for me. But I tell that this is an information that we might want to know because it is linked to a setup problem. And so we may want to put an alert when the person has set up a bad URL on the BO.
But if you think it is too much, I can remove it easily

@emawby emawby requested a review from nan-li January 30, 2024 19:55
@nan-li
Copy link
Contributor

nan-li commented Jan 30, 2024

Hi @MichaelOliveiraBx, thanks again for your PR.

An error-level log would be ideal, so we don't introduce another interface, since we don't have callbacks for other type of errors.

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