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.

When using postMessage to data.user, it invokes an infinite loop and keeps sending the same message.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
eponymzcommented, Mar 20, 2019

@duketis that would need to be your first conditional in that handler.

1reaction
eponymzcommented, Jan 6, 2019

You can avoid this by using this:

    // Only read messages that are not other bot messages
    if ((message.subtype && (message.subtype === 'bot_message' || message.subtype === 'message_replied')) || (message.message && message.message.subtype && message.message.subtype === 'bot_message')) {
      return
    }

EDIT: ^ that would be in the bot.on(‘message’) handler.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite Loop - Apple Store
Apple Store Infinite Loop store hours, contact information, and weekly calendar of events. ... Apple Infinite Loop. Open until 6:00 p.m.. Shop by...
Read more >
Infinite loop - Wikipedia
In computer programming, an infinite loop (or endless loop) is a sequence of instructions that, as written, will continue endlessly, unless an external ......
Read more >
Infinite Loop
Infinite Loop Music and Sound Production, Soundtracks, Sound Design, Recording Studio, Event Sound, Theatre Sound Design, Advertising, Commercials, ...
Read more >
What is infinite loop (endless loop)? | Definition from TechTarget
An infinite loop (sometimes called an endless loop ) is a piece of coding that lacks a functional exit so that it repeats...
Read more >
Infinite Loop in C - Javatpoint
An infinite loop is a looping construct that does not terminate the loop and executes the loop forever. It is also called an...
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