Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch Kobo API 404 errors instead of letting job fail [GRM] #238

Open
ritazagoni opened this issue Jan 15, 2025 · 8 comments
Open

Catch Kobo API 404 errors instead of letting job fail [GRM] #238

ritazagoni opened this issue Jan 15, 2025 · 8 comments
Assignees
Labels
enhancement New feature or request P2 Priority Level 2 - Medium

Comments

@ritazagoni
Copy link
Member

ritazagoni commented Jan 15, 2025

Background, context, and business value

This builds on #237 and will reuse code from that implementation.

We are fetching a list of Kobo forms from GoogleSheets then running the getGrmKoboData job to fetch submissions from those forms. However, sometimes those forms are not shared with the Kobo credential owner, which results in a 404.

Currently the job fails and halts if a 404 error occurs. Instead, we would like it to continue and store the forms that caused the 404 for printing/syncing back to GoogleSheets so that we can follow up.

A clear and concise description of what you want to happen.

Basically re-use the same pattern for what was implemented in #237, but will be implemented to this Grm job which connects to a different Kobo account and has slightly different behavior.

In the getGrmKoboData job

  1. store the URL/formId of the form that caused the error
  2. keep the job running and move on to the next form to process
  3. at the end, (1) throw an error
    and/or
  4. sync back the 404 error to the GoogleSheet to the row of the form(s) that caused it

⚠️⚠️ Important Notes: ⚠️⚠️

  1. Please work on this branch: fetch-grm-404-error-handling
  2. Do NOT merge to `master without consultant approval. This is sensitive data, so we want a very controlled deployment and go-live process.
  3. This job has some additional error handling logic (see here) that we want to keep in place.

Input

See grm_surveys_inputs.json and again be sure to work on this branch fetch-grm-404-error-handling

Credential

LP WCS Kobo Global Aggregation Account

adaptor

[email protected]

expression.js

getGrmKoboData

@aleksa-krolls
Copy link
Member

@ritazagoni this is the same spec as #237 yeah? Except targeting a different job, correct? Just want to make sure, and will update the issue description above accordingly to give the devs a heads up.

@martalovescoffee
Copy link

Note for Marta: Small change request for the client.

@martalovescoffee
Copy link

@hunterachieng estimate is needed. Should be the quick one :)

@hunterachieng hunterachieng added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Jan 23, 2025
@hunterachieng
Copy link
Collaborator

@ritazagoni and @aleksa-krolls I am unable to access the link of this file getGrmKoboData.js

@aleksa-krolls
Copy link
Member

hey @hunterachieng try now pls, thanks!

@hunterachieng
Copy link
Collaborator

@aleksa-krolls I have access. Thank you

@aleksa-krolls aleksa-krolls added the P2 Priority Level 2 - Medium label Jan 26, 2025
@aleksa-krolls
Copy link
Member

@hunterachieng when you start work on this issue, please see the important notes above and work off the designated branch!

@hunterachieng
Copy link
Collaborator

hunterachieng commented Jan 27, 2025

@aleksa-krolls This issue has been approved. Do you mind testing it? Here is the PR. Please also note the version of http adaptor being used is 6.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2 Priority Level 2 - Medium
Projects
None yet
Development

No branches or pull requests

4 participants