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

Fix event API errors not being parsed and returned #535

Merged
merged 5 commits into from
Apr 16, 2024

Conversation

jpwilliams
Copy link
Member

@jpwilliams jpwilliams commented Apr 9, 2024

Summary

When the event API responds with an error, we attempt to parse that error and include it in the Error returned to the user.

The tests for this, however, mocked the incorrect response from Inngest, resulting in the illusion of this functioning. The mock has been changed and the fix implemented by slightly changing the parsing of the response.

Checklist

  • Added a docs PR that references this PR N/A Bug fix
  • Added unit/integration tests
  • Added changesets if applicable

@jpwilliams jpwilliams added the Bug Something isn't working label Apr 9, 2024
@jpwilliams jpwilliams requested a review from amh4r April 9, 2024 13:05
@jpwilliams jpwilliams self-assigned this Apr 9, 2024
Copy link

changeset-bot bot commented Apr 9, 2024

🦋 Changeset detected

Latest commit: c85b9c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
inngest Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@inngest-release-bot inngest-release-bot added the 📦 inngest Affects the `inngest` package label Apr 9, 2024
error,
}
: {
status,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe our of scope for this PR, but do we test partial Event API failures? Like if you send 2 events where the 1st is valid and the 2nd is invalid

@jpwilliams jpwilliams merged commit 09ef143 into main Apr 16, 2024
36 checks passed
@jpwilliams jpwilliams deleted the fix/return-event-api-errors branch April 16, 2024 12:54
tonyhb pushed a commit that referenced this pull request Apr 16, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## inngest@3.16.2

### Patch Changes

- [#538](#538)
[`d9d57c4`](d9d57c4)
Thanks [@jpwilliams](https://github.com/jpwilliams)! - Fix `{ name:
string; }` objects being filtered out of `step.run()` responses when
nullable or a union

- [#536](#536)
[`73e04a5`](73e04a5)
Thanks [@jpwilliams](https://github.com/jpwilliams)! - Do not swallow
JSON parsing errors when syncing

- [#535](#535)
[`09ef143`](09ef143)
Thanks [@jpwilliams](https://github.com/jpwilliams)! - Fix sending
events sometimes returning generic errors when we can be more specific

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working 📦 inngest Affects the `inngest` package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants