OpenFn / grassroot-soccer

Grassroot Soccer CommCare-Salesforce integrations
https://openfn.github.io/grassroot-soccer/
0 stars 0 forks source link

Upsert Register Participant job is passing for some messages but not for others #43

Closed daissatou2 closed 11 months ago

daissatou2 commented 1 year ago

Describe the bug

The Upsert Register Participant job is passing for some messages but not for others. This example run is failing with the following error: ERROR_HTTP_400: Bad Request

Here’s a run from the same day that passed. The format we are sending to SF doesn’t seem to be different between the two so I am not sure what is causing the bad request error.

To Reproduce

  1. Here is a link to a failed run on OpenFn.org wihch is indicative of the bug: https://www.openfn.org/projects/grs-integrations/runs/064e6297-25dd-7ae3-97e6-4439f7ee0378

expression.js

Link to the job itself in Github: https://github.com/OpenFn/grassroot-soccer/blob/master/jobs/2.d.upsertRegisterParticipant.js

state.json

{
  "configuration": ["SEE LAST PASS: 'GRS Salesforce Sandbox'"],
  "data": "https://www.openfn.org/projects/grs-integrations/messages/064e5f59-d762-7a39-8ac5-0934b8cc5166"
}

Expected behavior

The job should successfully upsert Attendance__c records.

To test/resolve

  1. After the desired output is working locally (from the CLI), please [open a pull request].
  2. [Please test the change on OpenFn.org by re-running this run (https://www.openfn.org/projects/grs-integrations/runs/064e6297-25dd-7ae3-97e6-4439f7ee0378) and confirming success.]
daissatou2 commented 1 year ago

@mtuchi let's move forward with replacing accentuated characters to letters without accents. For example, "à" should become "a". See how we implemented this on the Itau Social project here. Please use the same list of characters as the Itau example.

You can test with the same state in the issue.

mtuchi commented 1 year ago

@daissatou2 i have added a function that does the replacement of accent characters, See the PR #45. The function is case sensitive so it will replace the uppercase match with corresponding uppercase character and same for lower case

daissatou2 commented 11 months ago

@mtuchi we are seeing the same error again for a new message: https://www.openfn.org/projects/grs-integrations/runs/06553185-a54b-7abe-a74d-698c3be4927a.

It looks like the accent is not being removed from the CommCare_Ext_ID__c

mtuchi commented 11 months ago

@daissatou2 i have open a PR that has improvements for replacing accents characters here #48