OpenFn / primero-progres

Interoperability solution for UNICEF <> UNHCR interagency referrals between Primero and Progres v4 systems.
https://openfn.github.io/primero-progres/
0 stars 2 forks source link

Job `sendErrorToDTP` is no longer sending error alerts to DTP, even when prior job fails #77

Closed aleksa-krolls closed 1 year ago

aleksa-krolls commented 1 year ago

Describe the bug

Thanks to issue #65 , the custom error handling is working well in Job1 of this flow. However, once this custom error is thrown (see example run)... then the next Job2 in the flow should send a "delivery failed" notification to Progres.

However, if you look at this next run no alert is being sent, even though Job1 failed.

I expect this error to be thrown... maybe in issue #65 we changed the logging in a way that broke how this Job2 works? Maybe the console.logs in Job1 need to contain the full string Service value shared in order for this job to behave as expected? https://github.com/OpenFn/primero-progres/blob/master/jobs/PROD/f1-3.sendErrorToDTP.js#L19-L23

To Reproduce

  1. Run job1 against this message: https://www.openfn.org/projects/primero-progres-v4-staging/messages/064f850c-6b81-7b25-8229-a7437cf3def2
  2. See how Job2 does not send an alert to DTP.

expression.js

Branch off of main and submit a PR when ready to test

state.json

Job1:

{
  "configuration": ["SEE LAST PASS: 'Primero Gambella Demo [openfn testing]'"],
  "data": "https://github.com/OpenFn/primero-progres/blob/master/sampleData/flow1__PrimeroOutgoingReferral.json",
  "cursor": "NA"
}

Job2 → Please comment out all operations so to not actually try sending this job to DTP… just try to resolve the console.log() issue.

{
  "configuration": "NA bc we don’t actually want to send DTP a notification in this test",
  "data": "Job1 final state",
  "cursor": "NA"
}

Expected behavior

After we job1 fails, we should send an error alert to DTP in job2.

Toggl

UNICEF Primero-Progres Support [2022-24]

aleksa-krolls commented 1 year ago

@mtuchi new UNICEF issue in prod - can you please take a look ASAP either today or tomorrow morning? cc @daissatou2 please see email to the client, and help with testing once Mtuchi has fixed this.

mtuchi commented 1 year ago

@aleksa-krolls here is the fix #79, i have tested it on staging to be safe but it seems like the credentials might not exist anymore See run log here