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

[Bug]: preventDefault not working as expected if app relaunch within 30s #1919

Open
1 task done
Harris-Cww opened this issue Nov 23, 2023 · 6 comments
Open
1 task done

Comments

@Harris-Cww
Copy link

Harris-Cww commented Nov 23, 2023

What happened?

preventDefault doesn't prevent notification from reappear if user relaunch within 30 sec since NotificationGenerationProcessor.doWork() has a 30 sec window to wait if preventDefault is called before actually calling markNotificationAsDismissed() to mark the notification as shown.

Steps to reproduce?

1. open app then receive a notification in INotificationServiceExtension
2. call preventDefault to stop OS notification from being shown and do custom handling
3. relaunch app within 30s
4. onNotificationReceived() is triggered again with previous notification

What did you expect to happen?

preventDefault should mark the notification as shown immediately and will not show again after app relaunch

OneSignal Android SDK version

release 5.0.4

Android version

13

Specific Android models

Pixel 4 XL, Android 13
Pixel 6 Pro, Android 14
Huawei P50 Pro, EMUI 12.0.1

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

@Harris-Cww thanks for reaching out! We're working on reproducing this and will get back to you as soon as possible.

@Harris-Cww
Copy link
Author

any update on this issue? I'm currently saving the notification id and compare it every time i receive push notification again, which is kinda troublesome. hope to have some better solution, thanks

@Aditya7521
Copy link

Aditya7521 commented Dec 20, 2023

@jennantilla
This issue can be regenerated when preventDefault is called from a fragment.
I cannot find a solution for this.
The preventDefault does not show the issue when used inside a activity.

@EgorSigolaev
Copy link

Any news on it? Facing the same issue

@kishibata
Copy link

I'm also facing the same issue. The symptoms of the following ticket may be similar.

#1977

@kishibata
Copy link

Hello @jennantilla
Could you please provide any updates on the status of this issue?

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

No branches or pull requests

5 participants