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

Webhook is sending empty request body #581

Open
shawnlknight opened this issue Jun 22, 2023 · 12 comments
Open

Webhook is sending empty request body #581

shawnlknight opened this issue Jun 22, 2023 · 12 comments

Comments

@shawnlknight
Copy link

We have an api endpoint that receives transaction webhooks. Specifically, we are checking if the webhook code is INITIAL_UPDATE or HISTORICAL_UPDATE (https://plaid.com/docs/api/products/transactions/#initial_update). This integration was working for about a year. Then, back in February, we updated from "plaid": "10.2.0" to "plaid": "12.3.0".

Nothing else was changed on our side. Now we get an empty request body from the Plaid webhook which has caused issues with our system.

I can see in our dashboard that the webhooks are fired successfully. Here is an example from production:
Screen Shot 2023-06-22 at 3 15 18 PM

We have since tried to downgrade back to "plaid": "10.2.0" but that has not helped the issue.

Can someone please help us figure out what would have changed to where we are now getting empty request bodies?

Thanks!

@phoenixy1
Copy link
Contributor

@shawnlknight webhooks don't integrate with the client libraries at all so this seems like it is probably not related to the client library upgrade (especially as downgrading didn't fix the problem). Can you file a support ticket including the relevant identifiers (such as item_id) so that the support team can look at the specific webhooks and investigate what's happening?

@shawnlknight
Copy link
Author

Thanks for the quick reply @phoenixy1 . I just filed a support ticket through the Plaid dashboard for this issue.

The reason I filed the issue here initially is because we started getting errors about the empty request body the same day we updated our version of plaid-node. Seemed like it could be correlated but obviously does not mean causation.

Thank you.

@cgfarmer4
Copy link
Contributor

@shawnlknight did this get resolved?

@shawnlknight
Copy link
Author

@shawnlknight did this get resolved?

@cgfarmer4 I filed a support ticket through their dashboard and they were very responsive but we were not able to resolve the issue.

@cgfarmer4
Copy link
Contributor

cgfarmer4 commented Sep 25, 2023

I see, so you're still receiving the webhooks but the request body is an empty blob? can you forward me the support ticket please?

@tiago-sanches-bairesdev

@cgfarmer4 The case ID of the support ticket helps?

@cgfarmer4
Copy link
Contributor

yea thats fine!

@tiago-sanches-bairesdev

@cgfarmer4 case ID #521412, Shawn gave an example of the piece of code we still using in the webhook endpoint setup, lemme know if you need something else.

@cgfarmer4
Copy link
Contributor

What version of Next are you all on? Want to try to reproduce on my end.

@tiago-sanches-bairesdev

@cgfarmer4 We are using Next v13.2.2

@tiago-sanches-bairesdev

for anyone struggling on that, i searched some stuffs about using nextjs API as a webhook, and I fixed it by adding the micro an using its function buffer, like the code below

  const rawBody = await buffer(req)
  const body = JSON.parse(rawBody.toString())

and this at the end of the code, outside the API function

export const config = {
  api: {
    bodyParser: false,
  },
}

@cgfarmer4
Copy link
Contributor

Thank you @tiago-sanches-bairesdev for the tip! Ill add this to our ReadMe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants