Given Reed
12/07/2022, 3:43 PMPG::UniqueViolation: ERROR: duplicate key value violates unique constraint "spree_shipping_rates_join_index"
DETAIL: Key (shipment_id, shipping_method_id)=(9, 2) already exists.
when I click "save and continue" after entering the shipping address.
Looking at the logs and I see
[1m[36mSpree::ShippingRate Create (0.7ms)[0m [1m[32mINSERT INTO "spree_shipping_rates" ("shipment_id", "shipping_method_id", "selected", "cost", "created_at", "updated_at", "tax_rate_id", "name", "easy_post_shipment_id", "easy_post_rate_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id"[0m [["shipment_id", 9], ["shipping_method_id", 2], ["selected", true], ["cost", "23.75"], ["created_at", "2022-12-07 15:25:17.919924"], ["updated_at", "2022-12-07 15:25:17.919924"], ["tax_rate_id", nil], ["name", "USPS Express"], ["easy_post_shipment_id", "shp_683cdccae3f34e65b8e77f997c6d84e1"], ["easy_post_rate_id", "rate_2d90fba67a874e62ae4dd45ac51ce490"]]
↳ app/controllers/checkouts_controller.rb:53:in `transition_forward'
[1m[36mSpree::ShippingRate Create (1.4ms)[0m [1m[32mINSERT INTO "spree_shipping_rates" ("shipment_id", "shipping_method_id", "selected", "cost", "created_at", "updated_at", "tax_rate_id", "name", "easy_post_shipment_id", "easy_post_rate_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id"[0m [["shipment_id", 9], ["shipping_method_id", 2], ["selected", false], ["cost", "23.75"], ["created_at", "2022-12-07 15:25:17.924424"], ["updated_at", "2022-12-07 15:25:17.924424"], ["tax_rate_id", nil], ["name", "USPS Express"], ["easy_post_shipment_id", "shp_683cdccae3f34e65b8e77f997c6d84e1"], ["easy_post_rate_id", "rate_127e8d2ca0504d1ea584d5b911678396"]]
↳ app/controllers/checkouts_controller.rb:53:in `transition_forward'
It appears to be trying to insert twice. I haven't done any shipping customizations, the store is still mostly vanilla. I'm running on solidus 3 (gem "solidus_core", "~> 3.2"). I can dig into the gem's code to try to figure it out, but was wondering if anybody had any ideas that would save me needing to dig around.mamhoff
12/07/2022, 4:44 PMmamhoff
12/07/2022, 4:44 PMmamhoff
12/07/2022, 4:45 PMGiven Reed
12/07/2022, 4:47 PMGiven Reed
12/15/2022, 6:02 PM