You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See #4480 for context, I think it's easier and should probably be done before this one.
These two other expensive methods on the OC serializer:
editable_variants_for_incoming_exchanges
editable_variants_for_outgoing_exchanges
These methods are renderer everytime the OC is renderer which is a now a big waste of resources, editable_variants_for_incoming_exchanges s only used in incoming settings page and editable_variants_for_outgoing_exchanges is only used in the outgoing exchange settings.
These methods are used to disable the checkboxes of variants that the user cannot edit.
These methods can be mode to the exchange_products_renderer. This is not so straight forward as #4480 because we need to change the payload of exchange_products_controller so that this information editable or not editable is passed to the client in the payload for each variant.
This will require a change in the SuppliedProductSerializer. We need to add a field to each variant in the hash of variants: editable: true/false. Maybe this is not that difficult!
Quick win
One possible quicker win in this context would be to make these methods not render any master variants (OCs dont take master variants). Currently, for each product we are serializing the master variant which in many cases duplicates the size of the payload.
Context
Came up from splitting the OC page in 3 steps.
Impact and timeline
This has a big impact/effort ratio, definitely something to be done soon.
The text was updated successfully, but these errors were encountered:
sigmundpetersen
changed the title
OC performance - move order_cycle_serializer#editable_variants_for_* to exchange_products_renderer#products_for_*
Move order_cycle_serializer#editable_variants_for_* to exchange_products_renderer#products_for_*
May 29, 2024
What we should change and why (this is tech debt)
See #4480 for context, I think it's easier and should probably be done before this one.
These two other expensive methods on the OC serializer:
These methods are renderer everytime the OC is renderer which is a now a big waste of resources, editable_variants_for_incoming_exchanges s only used in incoming settings page and editable_variants_for_outgoing_exchanges is only used in the outgoing exchange settings.
These methods are used to disable the checkboxes of variants that the user cannot edit.
These methods can be mode to the exchange_products_renderer. This is not so straight forward as #4480 because we need to change the payload of exchange_products_controller so that this information editable or not editable is passed to the client in the payload for each variant.
This will require a change in the SuppliedProductSerializer. We need to add a field to each variant in the hash of variants: editable: true/false. Maybe this is not that difficult!
Quick win
One possible quicker win in this context would be to make these methods not render any master variants (OCs dont take master variants). Currently, for each product we are serializing the master variant which in many cases duplicates the size of the payload.
Context
Came up from splitting the OC page in 3 steps.
Impact and timeline
This has a big impact/effort ratio, definitely something to be done soon.
The text was updated successfully, but these errors were encountered: