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.

[Alert Module] Multiple Alerts doesn't show as expected

See original GitHub issue

I found a bug in MagicMirror

Please make sure to only submit reproducible issues. You can safely remove everything above the dividing line. When submitting a new issue, please supply the following information:

Platform: Hyper-V Ubuntu

Node Version: v14.15.5

MagicMirror Version: 2.15.0

Description: According to issue https://github.com/Jopyth/MMM-Remote-Control/issues/256, when sending multiple alerts, the alert module can’t show every alert and just hide both.

Steps to Reproduce: Send one alert (I tried with a 60 seconds timer), and then send the same alert.

Expected Results:

2021-04-10 04-23-01 2

Actual Results:

2021-04-10 04-24-28 2

Configuration:

/*************** AUTO GENERATED BY REMOTE CONTROL MODULE ***************/

var config = 
{
  address: '0.0.0.0',
  electronOptions: {
    fullscreen: false
  },
  ipWhitelist: [],
  modules: [
    {
      module: 'MMM-Remote-Control',
      position: 'top_right',
      header: '',
      config: {
        showModuleApiMenu: true,
        customMenu: 'custom.json',
        secureEndpoints: false,
        classes: {
          test: {
            toggle: 'calendar'
          },
          'This is a test': {
            hide: [
              'calendar',
              'newsfeed'
            ],
            toggle: 'clock'
          },
          'this is another test': {
            show: [
              'calendar',
              'newsfeed'
            ],
            hide: [
              'clock'
            ]
          }
        }
      }
    },
    {
      module: 'updatenotification',
      position: 'top_bar',
      config: {}
    },
    {
      module: 'clock',
      position: 'top_left',
      header: '',
      config: {}
    },
    {
      module: 'calendar',
      header: 'US Holidays',
      position: 'top_left',
      config: {
        calendars: [
          {
            symbol: 'calendar-check',
            url: 'webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics'
          }
        ]
      }
    },
    {
      module: 'compliments',
      position: 'lower_third',
      classes: 'test',
      config: {}
    },
    {
      module: 'newsfeed',
      position: 'bottom_bar',
      disabled: true, // Here it's the disabled module
      config: {
        feeds: [
          {
            title: 'New York Times',
            url: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
          }
        ]
      }
    },
    {
      module: 'alert',
      header: '',
      config: {
        welcome_message: true
      }
    }
  ],
  useHttps: false,
  httpsPrivateKey: '',
  httpsCertificate: '',
  logLevel: [
    'INFO',
    'LOG',
    'WARN',
    'ERROR'
  ]
}

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}

Additional Notes: I made a fast hotfix, you could replace some lines inside https://github.com/MichMich/MagicMirror/blob/491f5aa7769a12de7f20f201de0078704c158a8d/modules/default/alert/notificationFx.js#L130

You’ll have the following:

setTimeout(() => {
    this.ntf.classList.add("ns-hide");

    //callback
    this.options.onClose();
}, 25);

Select all that, and replace it with:

this.ntf.classList.add("ns-hide");

Of course that solves the issue. I tried to take the “ns-hide” part out of the function, but onClose seems to deny the normal function of the module. I know that onClose shouldn’t be dismissed, but right now it’s the only way I found to bypass this bug.

Let me know if you need something else! Cheers 😄

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
MichMichcommented, Apr 10, 2021

Feel free to send a PR!

0reactions
ezeholzcommented, Apr 10, 2021

@rejas Install MMM-Remote-Control as stated here, and enter your mirror’s IP.

Of course this module isn’t necessary to reproduce this bug, you can send a notification to show that alert from any other module.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle multiple alerts firing at the same time
Hi you can present only one Alert at a time. if you want more in chain so first dismiss exist Alerts. Here is...
Read more >
Sitewide Alert | Drupal.org
This module can be used for showing alerts to your visitors to inform them of planned maintenance periods, shipping delays, flash sales, and ......
Read more >
Troubleshooting On-Save Legacy Workflows
After setting up an on-save workflow, the alerts or actions do not trigger when the conditions are met upon a record save. Resolution....
Read more >
How to handle PopUps and Alerts in Selenium with examples?
Alerts are small popup boxes/windows which display the messages/notifications and notify the user with some information seeking some ...
Read more >
Create a DPA Custom alert - SolarWinds Documentation
When you enter a Max value for a level, DPA alerts at that level when the value is greater than or equal to...
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