abeisgreat/python-firebasin — pull request #19 by perkinslr (2014-08-25 20:49:50+00:00)
Title: _keep_alive fails to keep the connection open.

self._send({"t":"d", "d":{"r":0}}) fails to keep the connection alive when connected to a paid firebase account. After about 1 minute of inactivity, the socket closes and triggers an unclean disconnect.
(('Closed down :(', 1006, 'Going away'),)
ws4py has a Heartbeat class which is designed to maintain the connection automatically, but it does not get initialized by firebasin. This replaces send() inside _keep_alive with a delayed start of ws4py's Heartbeat, which so far has prevented an unclean disconnect for me. If it is insufficient in all cases, it could be added along-side the existing method.

Additionally, child_added was not being triggered by structure.store when the last segment of root_path did does not exist inside the current Structure. Similarly, child_removed was not being triggered when root_path_data was None. This detects both situations and adds the event, path, and data to the list of changes.