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

Actions: fix bad action result for actions with empty return value #11813

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

bholmesdev
Copy link
Contributor

Changes

Fixes undefined result for actions with an empty return value.

  • Correctly return { data: undefined, error: undefined }

Testing

  • Add e2e test with logout button

Docs

N/A

Copy link

changeset-bot bot commented Aug 21, 2024

🦋 Changeset detected

Latest commit: 97334da

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

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Aug 21, 2024
Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

LGTM! Type wise I think it could be useful to turn the void return type into undefined

@bholmesdev bholmesdev force-pushed the fix/actions-empty-return-value branch from 49bbe38 to 97334da Compare August 22, 2024 09:54
@bholmesdev
Copy link
Contributor Author

@florian-lefebvre Hm, we always infer the return type directly from your handler. Special casting void -> undefined would add some complexity to the type defs. Is there an edge case where this assumption can break user code?

@bholmesdev bholmesdev merged commit 3f7630a into main Aug 22, 2024
13 checks passed
@bholmesdev bholmesdev deleted the fix/actions-empty-return-value branch August 22, 2024 11:02
@astrobot-houston astrobot-houston mentioned this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants