waitForNoResponse = async () => {
  // Wait for 2 seconds to check if we received a heartbeat message
  // This also leaves a buffer for the first heartbeat to be received
  await waitForMs(2000)

  const lastHeartbeat = responses.get(topics.heartbeat)

  // We send a heartbeat every second, so here we make sure the last heartbeat was received no more than 2 seconds ago (leaving a 1-second buffer)
  const isConnected = lastHeartbeat && Date.now() - lastHeartbeat < 2000

  if (isConnected) {
    return await waitForNoResponse()
  }

  return "Dev Mode Disconnected: This AWS Lambda function is instrumented with Serverless Framework's Dev Mode but the Dev Mode session is no longer active. Run `serverless dev` to reconnect, or `serverless deploy` to remove Dev Mode's instrumentation and restore the original code."
}
This function resolves only if we haven't received a heartbeat message from the local machine in the last 2 seconds.
If we receive a heartbeat message, we wait for 2 seconds and then call the function again to check again.
@returns