jwoglom / tconnectsync

Syncs insulin pump data from Tandem t:connect to Nightscout for the t:slim X2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with --check-login

jyaw opened this issue · comments

I am getting a couple API errors. Any feedback is appreciated. I've uploaded the --check-login log file for reference and pasted some of the error output below. Saw some issues related to API re-work in the last couple months, not sure if this is related. I've double-checked my passwords, etc.

Issue 1: when querying the Control IQ API for dashboard summary
Issue 2: getting a RemoteDisconnected error on the WS2 API

Error occurred querying ControlIQ API for dashboard_summary:
ControlIQ API HTTP 403 response:

<title>403 Forbidden</title> ...

Logging in to t:connect WS2 API...
Error occurred querying WS2 API:
('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Querying WS2 therapy_timeline_csv...
Error occurred querying WS2 therapy_timeline_csv:
('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
...

Needed to further sanitize the log, thought I got everything... will upload tomorrow.

@jyaw I think I have an idea of what's going on with the ControlIQ dashboard_summary issue. The way tconnectsync is making the query was slightly off with how tconnect itself queries Tandem's API, which set off the Azure WAF. (same root cause as #38 (comment)) I've added a workaround (the argument order of start and end were not being set in a consistent order). This dashboard_summary is just used as a test that the API is working for --check-login and doesn't actually affect the operation of tconnectsync since we don't call it.

The remotedisconnected error on the WS2 API is actually likely also not a concern so long as you don't have pump events or IOB features enabled, because we can use the new endpoints. I just haven't removed the code in the check script to no longer query those endpoints, since they are still used in some cases. I've updated the ws2 api to have an explicit timeout so that it doesn't hang indefinitely.

Oh ok, sounds like I'll move on with getting started then. Thanks for the quick response!

On the dashboard summary, should it be resolved if you fixed it in a previous version? Or is the workaround still needed in --check-login?

Should there be a logged comment about WS2 not being needed for baseline functionality?

On the dashboard summary, should it be resolved if you fixed it in a previous version? Or is the workaround still needed in --check-login?

I implemented the workaround for a different ControlIQ endpoint (therapy_timeline) and just now did the same workaround for dashboard_summary. So if you update to the latest version you'll get the fix.

Should there be a logged comment about WS2 not being needed for baseline functionality?

check-login now does exactly this: 8f6d037#diff-c21e4fadd9e754ce2202561c7c70babfe039e42fe77effa8df182747ab6c092bR132

--check-login works now with the updated debug comments. Closing. Thanks!