pipedream icon indicating copy to clipboard operation
pipedream copied to clipboard

Brevo

Open pipedream-component-development opened this issue 1 year ago • 1 comments

App

Brevo

Summary:

Fails to add new contact when email not found

Details:

I got this error in a recent workflow run. It makes no sense, because when the value passed to "Contact" (which can be an ID or email according to the docs) is not found, it should fall back on simply adding a new contact.

AxiosError - Request failed with status code 404
{"code":"document_not_found","message":"Contact does not exist"} 
    at null.settle (/pipedream/dist/code/f957e296eee733c4736681a2c09f0a8644d946f993b71c0e4d24807278ea53c3/node_modules/.pnpm/[email protected]/node_modules/axios/dist/node/axios.cjs:1967:12)
    at Unzip.handleStreamEnd (/pipedream/dist/code/f957e296eee733c4736681a2c09f0a8644d946f993b71c0e4d24807278ea53c3/node_modules/.pnpm/[email protected]/node_modules/axios/dist/node/axios.cjs:3066:11)
    at Unzip.emit (node:events:530:35)
    at null.endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.callAxios (/pipedream/dist/code/f957e296eee733c4736681a2c09f0a8644d946f993b71c0e4d24807278ea53c3/node_modules/.pnpm/@[email protected]/node_modules/@pipedream/platform/dist/axios.js:110:26)
    at Object.existingContactByIdentifier (file:///pipedream/dist/code/f957e296eee733c4736681a2c09f0a8644d946f993b71c0e4d24807278ea53c3/code/brevo.app.mjs:39:16)
    at Object.run (file:///pipedream/dist/code/f957e296eee733c4736681a2c09f0a8644d946f993b71c0e4d24807278ea53c3/code/actions/add-or-update-contact/add-or-update-contact.mjs:58:17)
    at null.executeComponent (/var/task/launch_worker.js:286:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:785:28)
(add_or_update_contact)

Screenshots:

Screenshot

I can reproduce this issue image

vunguyenhung avatar May 14 '24 01:05 vunguyenhung

Hi everyone, all test cases are passed! Ready for release!

Test report https://vunguyenhung.notion.site/Brevo-a0cb15ea187f4ed69ca57e607623bde9

vunguyenhung avatar May 28 '24 05:05 vunguyenhung

@vunguyenhung It seems the opposite issue is occurring now: it doesn't correctly handle the case when the contact already exists.

AxiosError - Request failed with status code 400
{"code":"duplicate_parameter","message":"Contact already exist"}

alexreg avatar Jun 26 '24 00:06 alexreg

@vunguyenhung I'm not sure how you're doing this in code, but you probably just want to set the updateEnabled parameter to true, as per the documentation.

alexreg avatar Jul 02 '24 02:07 alexreg

Hey @alexreg, thank you for reporting your issue.

I've created a new ticket here and added it to priorized backlog

vunguyenhung avatar Jul 02 '24 04:07 vunguyenhung