fixes for embedded resources within unions#2676
Merged
zachdaniel merged 1 commit intoash-project:mainfrom Apr 15, 2026
Merged
Conversation
zachdaniel
approved these changes
Apr 15, 2026
Contributor
|
Seems reasonable to me 😄 🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes fix a few issues that I ran into with unions of embedded resources.
What I'm trying to do is:
storage: :map_with_tagsourcefield that remaps them from what's in the DB (the DB versions are camel case because of bad past decisions)I've run into a few issues doing this. I worked with opencode to get to some solutions here. I'm struggling to put together good test reproductions since this is kind of a niche use case and I've mostly been testing it against my own codebase.
The issues themselves are:
def load(unions, [], _, _), do: {:ok, unions}function headloadvariable to[]in the main function head__union_tag__property was not being properly included in a few code paths that handle updates, resulting in errors aboutNo such input type for action <MyAction>(typeis my tag key)__union_tag__in the constraints in those code pathscleanup_field_authfunction. To be transparent, I understand these changes less well than I do the other two—opencode is mostly responsible for these. I would appreciate a bit of a closer look at this section from someone with a much closer understanding of this module's code.Contributor checklist
Leave anything that you believe does not apply unchecked.