MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Same notif received multiple time

    Scheduled Pinned Locked Moved Troubleshooting
    1 Posts 1 Posters 1.1k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • romainR Offline
      romain
      last edited by

      I sometime receive the same notification multiple time, like if the mirror run my module twice or something. It’s not happening every time.
      As an example, I have a module that send a socket notification in the start function to the node helper to initialise something. let’s call it Notif_A.
      l catch it the notification, make sure it’s Notif_A with an if statement, and When the node helper did it’s job it send back the data he got. still with a send socket notification Let’s call it Notif_B.
      The odd thing is that I sometime got into the if that check if it received Notif_B twice in a row. Like if I got the notif twice.
      The thing is, I only send Notif_A in the start function And I only send Notif_B if I received Notif_A.

      I also noticed that the getDom function on some modules are callde 2 or 3 time in the raw at the begining (I checked with console.log)

      So… what’s happening here ? Why is the notification is catched twice ? Is the start function runned twice for some reason ?

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post
      Enjoying MagicMirror? Please consider a donation!
      MagicMirror created by Michael Teeuw.
      Forum managed by Sam, technical setup by Karsten.
      This forum is using NodeBB as its core | Contributors
      Contact | Privacy Policy