diff --git a/lib/pairing.js b/lib/pairing.js index 5932878c..e795e8b1 100644 --- a/lib/pairing.js +++ b/lib/pairing.js @@ -15,9 +15,10 @@ function pullToken (token) { function unpair (deviceId) { const sql = 'delete from devices where device_id=$1' const deleteMachinePings = 'delete from machine_pings where device_id=$1' + const deleteMachineHeartbeat = 'delete from machine_network_heartbeat where device_id=$1' // TODO new-admin: We should remove all configs related to that device. This can get tricky. - return Promise.all([db.none(sql, [deviceId]), db.none(deleteMachinePings, [deviceId])]) + return Promise.all([db.none(sql, [deviceId]), db.none(deleteMachinePings, [deviceId]), db.none(deleteMachineHeartbeat, [deviceId])]) } function pair (token, deviceId, machineModel) {