homebridge-hatch-baby-rest icon indicating copy to clipboard operation
homebridge-hatch-baby-rest copied to clipboard

Plugin crash after latest Rest updates

Open chaseconey opened this issue 1 year ago • 1 comments

Overview

It seems this plugin is crashing after Hatch released their latest updates to the Hatch app (or at least the start of the crash corresponds to the launch of the new features). When trying to turn on the Rest 2nd Gen, homebridge crashes and completely restarts.

Turning off does seem to still function properly.

Details

image

Logs

[1/28/2024, 12:14:54 PM] [HatchBabyRest] Turning on first favorite for Sleep Pod
[1/28/2024, 12:14:54 PM] TypeError: Cannot read properties of undefined (reading 'id')
    at RestIot.<anonymous> (C:\Users\comp\AppData\Roaming\npm\node_modules\homebridge-hatch-baby-rest\lib\homebridge-hatch-baby-rest\rest-iot.js:38:56)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\comp\AppData\Roaming\npm\node_modules\homebridge-hatch-baby-rest\lib\homebridge-hatch-baby-rest\rest-iot.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

chaseconey avatar Jan 28 '24 18:01 chaseconey

Thanks for the heads up! I haven't upgraded my app yet, but will take a look when I get a chance. Might not be till this weekend

dgreif avatar Jan 29 '24 15:01 dgreif

I ran into this as well while setting up the plugin for the first time. My Hatch Rest+ is using the latest update. It appears to be an issue setting the current favorite when an empty array is returned from fetching all favorites. I added an early return to the method to resolve the error but no routine or favorite is set when turning on the device from Homebridge or HomeKit. Not sure what Hatch changed to this data.

HipsterBrown avatar Feb 01 '24 21:02 HipsterBrown

This is fixed in v4.1.0

dgreif avatar Feb 04 '24 14:02 dgreif