From ec841b9591ff7b059e93d19c427cb7c8ff12d27c Mon Sep 17 00:00:00 2001 From: inportb Date: Mon, 1 May 2023 17:17:44 -0400 Subject: [PATCH] Fix broken connection detection; disallow stale XWB_IM_HERE --- htdocs/vistax.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/vistax.mjs b/htdocs/vistax.mjs index 198af90..1fc37b8 100644 --- a/htdocs/vistax.mjs +++ b/htdocs/vistax.mjs @@ -339,7 +339,7 @@ export function Client(cid, secret) { if(localstate.practitioner) delete localstate.practitioner; }; - this.XWB_IM_HERE = unwrapped(logged(() => this.call({ method: 'XWB_IM_HERE', ttl: 30 }), 'XWB_IM_HERE')); + this.XWB_IM_HERE = unwrapped(logged(() => this.call({ method: 'XWB_IM_HERE', ttl: 30, stale: false }), 'XWB_IM_HERE')); this.XUS_INTRO_MSG = memoized(unwrapped(logged(() => this.callctx(['XUCOMMAND'], 'XUS_INTRO_MSG'), 'XUS_INTRO_MSG'))); this.XWB_GET_BROKER_INFO = memoized(unwrapped(logged(() => this.callctx(['XUCOMMAND'], 'XWB_GET_BROKER_INFO'), 'XWB_GET_BROKER_INFO'))); @@ -463,7 +463,7 @@ Client.fromCookie = async function(secret, defaulthost='vista.northport.med.va.g console.log('Using saved secret and connection', secret); var cid = localstate.cid; var client = Client.fromID(cid, secret); - if((await vista.call(cid, { method: 'XWB_IM_HERE', ttl: 30, id: Date.now() })).result == '1') { + if((await vista.call(cid, { method: 'XWB_IM_HERE', ttl: 0, stale: false, id: Date.now() })).result == '1') { var server = await client.serverinfo(); if((host[0] == server.result.host) && (host[1] == server.result.port)) { localstate.host = host.join(':');