question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clear_notification command not working when several notifications are shown

See original GitHub issue

Home Assistant Android version: 2021.3.1-full

Android version: 11

Phone model: Oppo Find X2 Pro (ColorOS 11) Xiaomi Mi 9 (MIUI 12.0.4)

Home Assistant version: core-2021.3.2 Python 3.9 virtual env

Last working Home Assistant release (if known): None

Description of problem: I’m using an automation that notify user’s mobile apps that some windows are opened. When the window is closed, the notification is cleared on all the mobile apps. It works perfectly when a single window is opened and closed. But when two windows are opened, it creates two notifications, and when the windows are closed, only one notification is cleared, the second one remains on the phones until manually dismissed.

I made the automation below to reproduce the issue. One notification is created, and cleared after 5 seconds, then a second notification is created with a different tag, and then cleared after 5 seconds. Then the first notification is created again ; 5 seconds later the second notification is created ; 5 seconds later the first notification is successfully cleared, but 5 seconds later the second notification is not cleared as expected .

`alias: Notifications Test description: Creates and clear one or multiple notifications on mobile app trigger: [] condition: [] action:

  • service: notify.notify data: title: Test notification message: Create notification 1 data: ttl: 0 priority: high tag: tag_one color: yellow
  • delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0
  • service: notify.notify data: title: Test notification message: clear_notification data: ttl: 0 priority: high tag: tag_one color: yellow
  • delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0
  • service: notify.notify data: title: Test notification message: Create notification 2 data: ttl: 0 priority: high tag: tag_two color: green
  • delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0
  • service: notify.notify data: title: Test notification message: clear_notification data: ttl: 0 priority: high tag: tag_two color: green
  • delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0
  • service: notify.notify data: title: Test notification message: Create notification 1 data: ttl: 0 priority: high tag: tag_one color: yellow
  • delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0
  • service: notify.notify data: title: Test notification message: Create notification 2 data: ttl: 0 priority: high tag: tag_two color: green
  • delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0
  • service: notify.notify data: title: Test notification message: clear_notification data: ttl: 0 priority: high tag: tag_one color: yellow
  • delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0
  • service: notify.notify data: title: Test notification message: clear_notification data: ttl: 0 priority: high tag: tag_two color: green mode: parallel max: 10 `

Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):

[logcat_03-16-2021_09-04-02.txt](https://github.com/home-assistant/android/files/6147050/logcat_03-16-2021_09-04-02.txt)

Screenshot of problem:

Additional information:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
chriss158commented, Mar 24, 2021

I could reproduce this issue and fixed it in the PR #1452

Thanks @ScratMan for the logs and testing 👍

2reactions
ScratMancommented, Mar 24, 2021

Hi, here is a new log with the beta. I could reproduce the issue the same way. [ logcat_03-24-2021_21-16-40.txt ](url)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Showing Error message after clearNotification() on field ...
I executed below code and its working fine . function OnChange_EstimatedCloseDate(executionContext) { debugger; // alert("step 1"); var ...
Read more >
control.clearNotification (Client API reference) - Microsoft Learn
If the uniqueId parameter isn't specified, the currently displayed notification will be cleared. Return Value. Type: Boolean. Description: ...
Read more >
Set and Clear Notifications: {Info/Warning/Error} on Dynamics ...
Type: String. The level of the message. The level defines how the message will be displayed. ERROR : Notification will use the system...
Read more >
Clear Notification - Microsoft Power Platform & Dynamics 365
The notification options available at form-level are: Error, Warning and Information. These notification options have different icons as shown ...
Read more >
Form and Fields Notification in Dynamics 365 Part 1 - HIMBAP
If user will enter some text under telephone field it will show the error notification like following: setnotification2. clearNotification
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found