Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Cart updates corrupt pagination link targets #531

Closed
@orenyk

Description

@orenyk

Via BMEC (Chris):
If you change anything in the cart and then click on the lower navigation links, it takes you to a pure HTML rendering of the cart (see screenshot below). I have verified this issue on my local instance on the development branch. I have diagnosed the following:

  • before the cart is changed, the pagination elements have the expected targets, e.g. http://0.0.0.0:3000/?page=2
  • after the cart is changed but before it updates (latency as in Fix cart latency #523), the link targets remain the same
  • once the cart is updated on the server side, the lower pagination element targets change to something like http://0.0.0.0:3000/catalog/update_cart?authenticity_token=K8t2MV22FNT%2BjOLc0rOY6D3uwv%2F3qDD3nsIoGZS63NI%3D&cart%5Bdue_date_cart%5D=05%2F22%2F2014&cart%5Bstart_date_cart%5D=05%2F09%2F2014&fake_reserver_id=&page=2&reserver_id=1&utf8=%E2%9C%93 and the upper element targets change to something like http://0.0.0.0:3000/?authenticity_token=K8t2MV22FNT%2BjOLc0rOY6D3uwv%2F3qDD3nsIoGZS63NI%3D&cart%5Bdue_date_cart%5D=05%2F22%2F2014&cart%5Bstart_date_cart%5D=05%2F09%2F2014&fake_reserver_id=&page=2&reserver_id=1&utf8=%E2%9C%93
    • I verified this with date changes, but I saw it happen with cart items as well while meeting w/ Chris
    • it looks like whatever routes we're hitting with the cart update mechanism are getting picked up by our pagination gem and therefore we're sending the whole request along with the page parameter
    • for some reason, the lower and upper links are hitting different routes; the lower links are going to ROOT/catalog/update_cart while the upper links are going to ROOT; this explains why only the lower elements redirect to the weirdness.
  • based on what @caseywatts thought, it seems like the ROOT/catalog/update_cart route calls some JS that is returning only the HTML of the updated cart, hence the weirdness.

This needs to be properly debugged and fixed. Good luck!

selection_008

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions