data-liberation-project / aphis-inspection-reports

Inspection data and PDFs from the USDA's Animal and Plant Health Inspection Service.
13 stars 3 forks source link

Automatically flag/alert when `fwuid` for API calls need changing #49

Closed jsvine closed 1 year ago

jsvine commented 1 year ago

Occasionally, one of the required parameters on the API calls needs to be updated. We can theoretically know because the call will fail and instead return a message like this in the HTTP body:

*/{"event":{"descriptor":"markup://aura:clientOutOfSync","eventDef":{"descriptor":"markup://aura:clientOutOf
Sync","t":"APPLICATION","xs":"I"}},"exceptionMessage":"Framework has been updated. Expected: Yf79GSf0tCGqGtchn
yT8-Q Actual: Vo_clYDmAijdWOzW3-3Mow","exceptionEvent":true}/*ERROR*/

It should be possible to add an alerting system to flag when the change is required. I'll look into this.

jsvine commented 1 year ago

Decided to just dynamically fetch the current FWUID before each run. Seemed like the simplest approach, rather than alerting/flagging, and seems to work fine. Changes in 978fb7545d.