Skip to content

Conversation

@DGollings
Copy link
Contributor

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

Otherwise as discussed @zachdaniel (I presume)

@DGollings DGollings force-pushed the main branch 3 times, most recently from ce86c98 to fa4f2cb Compare October 28, 2025 16:05
@zachdaniel
Copy link
Contributor

I believe the last thing we want to do is make sure that this key is cleared from any resulting record's metadata.

@DGollings
Copy link
Contributor Author

I believe the last thing we want to do is make sure that this key is cleared from any resulting record's metadata.

done plus test

@zachdaniel
Copy link
Contributor

We're close! Thank you so much for bearing with me on this one.

@DGollings DGollings force-pushed the main branch 3 times, most recently from e0018e2 to c2136df Compare October 31, 2025 15:15
@DGollings
Copy link
Contributor Author

DGollings commented Oct 31, 2025

We're close! Thank you so much for bearing with me on this one.

Appreciate (and understand) the thorough review :)
Resolved your comments in c2136df

Updated and also opened ash-project/ash_postgres#645 and ash-project/ash_sqlite#189 (the latter needs some work tests should pass, but because I do not use ash_sqlite its harder to thoroughly test)

It passes my repro test, please review
(I'll check the failing CI jobs asap)

|> Ash.Changeset.prepare_changeset_for_action(action, opts)
|> Ash.Changeset.set_private_arguments_for_action(opts[:private_arguments] || %{})
|> Ash.Changeset.put_context(context_key, %{index: index})
|> Ash.Changeset.put_context(:bulk_update, %{index: index, ref: ref})
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to use the context_key variable here and make sure we aren't hardcoding it.

:destroy ->
{:bulk_destroy, :bulk_destroy_index}
end
context_key = :bulk_update
Copy link
Contributor

Choose a reason for hiding this comment

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

We still need to switch on action.type so that this uses the action type for these three values. For destroys the context key, metadata key, and ref_metadata_key need to be based on the action type.

removed unnecessary find_changeset_by_index
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