OpenFn / unicef-cambodia

UNICEF Cambodia - Primero Interoperability
https://openfn.github.io/unicef-cambodia/
1 stars 2 forks source link

f1-j2 TypeError run failure & state too big #55

Closed aleksa-krolls closed 3 years ago

aleksa-krolls commented 3 years ago

This is related to the changes we made for #53, but now for the Primero --> Oscar direction. I think we need to also handle here for when cases might NOT have services.

The Issues

There are 3 things...

  1. JS error: TypeError [Error]: Cannot read property 'map' of undefined - See run 9982016. I think this is failing because some Primero cases we are now sending back to Oscar do not have services... however I want to make sure this is indeed related to the changes we made for #53 (and not an issue with the test data in the staging environment).

  2. We're getting that state too big email when f1-j1-getPrimeroCases.js is run, even though we're only fetching 15 cases (see run here). This seems a little low to be raising this issue, no?

  3. I think we need to add a per parameter to f1-j1 per the Primero API docs section 1.4: https://docs.google.com/document/d/1jpaT2_UBBnc3PxPYlLMBEzNUkyfuxRZiksywG5MKM0Q/edit#

state.json

To produce state, run f1-j1-getPrimeroCases.js locally. For creds, see LP 'UNICEF Primero Alpha API User Login' (oscar-user).

To test

Re-run f1-j1 on prod: https://www.openfn.org/projects/1671/jobs/2435