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

docs: correct return type for around_action #1478

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

vonagam
Copy link
Contributor

@vonagam vonagam commented Sep 25, 2024

Question: it is not mentioned but around_action is not compatible with atomic (as in, those hooks are not executed if changeset is atomic), correct?

@zachdaniel
Copy link
Contributor

The hooks shouldn't be ignored, they will just cause the action not to be able to be run atomically. So you'd get an error if you tried to run it with require_atomic?: true, or in some way that requires atomics, like strategy: :atomic with bulk actions.

@zachdaniel zachdaniel merged commit ee0488b into ash-project:main Sep 25, 2024
32 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

@vonagam vonagam deleted the docs-around-action-return branch September 25, 2024 21:11
@vonagam
Copy link
Contributor Author

vonagam commented Sep 25, 2024

Hm... I see so it is not supported. For record I've had a custom change that had def atomic that was returning {:ok, change(changeset, ...)} and in that change() I was setting around_action and after_action. And it was trying to run changeset skipping around_action and throwing in after_action (that depends on stuff from around action).

@zachdaniel
Copy link
Contributor

Ah, interesting...yeah, probably a last-minute check that no atomic callbacks have added those hooks is necessary.

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

Successfully merging this pull request may close these issues.

2 participants