Skip to content

feat: Remove address cloning#179

Merged
sveneberth merged 4 commits into
developfrom
feat-no-address-cloning
May 12, 2026
Merged

feat: Remove address cloning#179
sveneberth merged 4 commits into
developfrom
feat-no-address-cloning

Conversation

@phorward
Copy link
Copy Markdown
Member

@phorward phorward commented Apr 7, 2026

Removes the address cloning mechanism that was previously used to snapshot
shipping addresses during order freeze. Instead, address data is now persisted
directly via relational bone configuration.

Before: When freezing an order/cart, clone_address() created a full copy
of the address record and stored a cloned_from back-reference.

After: CartNodeSkel.shipping_address (and the corresponding bone in
OrderSkel) uses refKeys="*" with updateLevel=UpdateLevel.OnValueAssignment,
capturing the full address at assignment time. Additionally, shipping_address
is added to frozen_values on CartNodeSkel to prevent later mutation.

Changes

  • Remove clone_address() method and all call sites in cart.py / order.py
  • Remove cloned_from RelationalBone from AddressSkel
  • Set refKeys="*" and updateLevel=UpdateLevel.OnValueAssignment on shipping
    address bones in cart/order skeletons
  • Add shipping_address to CartNodeSkel.frozen_values
  • Drop now-unused shop_address Datastore index on cloned_from
  • Remove viur.shop.skeleton.address.cloned_from translation keys

@sveneberth
Copy link
Copy Markdown
Member

Maybe write address to frozen_values

@phorward phorward requested a review from sveneberth April 28, 2026 16:17
@phorward phorward assigned phorward and unassigned KadirBalku Apr 28, 2026
(this is what previously the address cloning did)
@phorward phorward marked this pull request as ready for review April 28, 2026 16:21
@sveneberth sveneberth changed the base branch from main to develop May 12, 2026 13:04
@sveneberth sveneberth merged commit cbb006a into develop May 12, 2026
5 checks passed
@sveneberth sveneberth deleted the feat-no-address-cloning branch May 12, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants