Skip to content

fix: preserve Mirror context attributes in build_child_ctx#32

Merged
zachdaniel merged 1 commit into
ash-project:mainfrom
vasspilka:fix-mirror-build_child_ctx
May 29, 2026
Merged

fix: preserve Mirror context attributes in build_child_ctx#32
zachdaniel merged 1 commit into
ash-project:mainfrom
vasspilka:fix-mirror-build_child_ctx

Conversation

@vasspilka
Copy link
Copy Markdown
Contributor

@vasspilka vasspilka commented May 28, 2026

Summary

Mirror.build_child_ctx/2 was rebuilding the child Context from a hard-coded subset of fields (service_opts, resource, attachment, actor, tenant), silently dropping anything else the parent context carried — e.g. expected_md5 and any future Context additions.

Replace the rebuild with %{parent | service_opts: child.opts} so every attribute on the parent propagates to the child, with only the per-service opts overridden.

Tests

New context propagation describe block in test/ash_storage/service/mirror_test.exs covers:

  • download fails with :checksum_mismatch when expected_md5 is wrong (proves the field now reaches the child)
  • download succeeds when expected_md5 matches
  • fall-through to the secondary service still propagates expected_md5

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

🤖 Generated with Claude Code

@zachdaniel zachdaniel merged commit 9316831 into ash-project:main May 29, 2026
20 of 24 checks passed
@zachdaniel
Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

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