Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move order_cycle_serializer#editable_variants_for_* to exchange_products_renderer#products_for_* #4481

Open
Tracked by #4610
luisramos0 opened this issue Nov 22, 2019 · 0 comments

Comments

@luisramos0
Copy link
Contributor

luisramos0 commented Nov 22, 2019

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:

  • 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.

@sigmundpetersen 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: All the things 💤
Development

No branches or pull requests

1 participant