1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/social/pushbullet
guzba ff9d21827d
Attempt to mitigate stream server connect feedback loop
Pushbullet dev here. Around 36 hours ago we started receiving around 750 additional requests per second to connect to our stream server. I blocked around 50 - 100 IP addresses to mitigate the spam. This spam traffic has continued unchanged since then.

I don't know for sure what caused this, but one user came forward reporting issues with their Node-Red setup after I banned the IPs (status code is my banned IP status code which is pretty compelling evidence). I can't be sure what is causing the issue since no User-Agent is included in the requests, but it for sure is at least partly Node-Red API users. I'd like to work on mitigating this since mitigating the spam traffic costs money.

My first theory here is in this PR. I am not aware of any guarantees that you'll never get multiple 'error' events, so it makes sense to clear the timeout before setting a new one to reconnect. Even if it is just defensive, it may not have much cost? If you do get multiple error events without this change, it is possible to trigger many connect() requests which can error out and then trigger many more connect() requests with lots of timeouts, which is not good.

Another thing to consider is that this library's dependency for PB (https://github.com/alexwhitman/node-pushbullet-api) already has code to reconnect if a websocket connection is lost without having been properly closed. I think an even better solution is verifying this works and then deleting the reconnect logic from here.

I'm not an expert on Node-Red though so I am only trying to offer suggestions to ensure everyone is a good citizen when using our API :) Thanks!
2020-10-13 16:27:30 -05:00
..
icons Move nodes over from main repo 2013-10-30 20:38:41 +00:00
57-pushbullet.html Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
57-pushbullet.js Attempt to mitigate stream server connect feedback loop 2020-10-13 16:27:30 -05:00
LICENSE Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
package.json bump pushbullet package for PR 2020-09-27 12:59:02 +01:00
README.md update social nodes info style 2016-03-02 13:27:52 +00:00

node-red-node-pushbullet

A Node-RED node to send alerts via Pushbullet.

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

npm install node-red-node-pushbullet

Usage

Pushbullet output node

Uses PushBullet to push msg.payload to a device that has the PushBullet app installed.

  • Optionally uses msg.topic to set the title, if not already set in the properties.
  • Optionally uses msg.pushtype to set the type of the push, if not already set in the properties.
  • Optionally uses msg.deviceid to set the device ID, if not already set in the properties.

You can also push to any channels that you own either configured or via msg.channel.

The node can also dismiss and delete any push and update items in a pushed list. In this case msg.data.iden must be set to a valid push id, if msg originates from the Pushbullet input node this value is already set.

Pushbullet input node

Receives Pushbullets from all devices. Messages contain the following data:

  • msg.pushtype: type of message
  • msg.topic: topic information from the push
  • msg.payload: main content of the push
  • msg.data: original object from the pushbullet API containing e.g. sender, receiver and message ids.

Pushes of type link and file will also have msg.message containing the message associated with the push.

For further details of see Pushbullet Stream API and Pushbullet Push API.