simont77 / fakegato-history

Module to emulate Elgato Eve history
MIT License
167 stars 15 forks source link

Fixes for google drive availability issues #54

Closed NorthernMan54 closed 6 years ago

NorthernMan54 commented 6 years ago

1 - Added retries and error handling for initial load of data from google drive ( readFile )

2 - Added handling for write errors to google drive ( writeFile )

3 - Ran Beautify against googleDrive.js

Test cases

1 - Emulate restart after power failure by starting homebridge without internet access, then enabling internet access a few minutes later

2 - Emulate internet connection dropping and reconnecting by disabling internet access for a few minutes while homebridge is already running.

simont77 commented 6 years ago

Is there any specific reason for this change: -var hostname = os.hostname(); +var hostname = os.hostname().split(".")[0];

I fear that one will loose all previuos history with it.

NorthernMan54 commented 6 years ago

During testing I saw that the hostname of my Mac had changed when the internet is down. When the internet was down, the hostname was Maggie.local, versus Maggie when the internet was working.

For me it caused loss of data during the internet down scenario, as the file name changed.

Sent from my iPad

On Apr 18, 2018, at 2:24 AM, simont77 notifications@github.com wrote:

Is there any specific reason for this change: -var hostname = os.hostname(); +var hostname = os.hostname().split(".")[0];

I fear that one will loose all previuos history with it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

simont77 commented 6 years ago

uhm, I see. I checked this out, and on my raspberry the hostname is simply raspberrypi, on one Mac is xxx.local and on another one is yyy.lan... So, it seems that hostname returns the actual hostname on linux, and, by default, the full hostname on BSD. At this point I agree with you, it's better to strip the part after the dot, I will add a warning in the readme for those having long hostnames.