Skip to content
Snippets Groups Projects
Commit bc11b1ec authored by Romain Derie's avatar Romain Derie
Browse files

[FIX] website_sale: prevent race condition on tour


As this race condition seems not possible to be reproduced in local, all this
is an assumption based on the logs.

After the checkout, the user is redirected to `/shop/confirmation` where there
is RPCs fired ever seconds to fetch the payment status
(`/shop/payment/get_status`).

As the test was considered as finished on that page, sometimes the RPC would
still be processed in python while the tour was considered done and killed,
thus also the cookies, session & co.
From that point, the python would crash when accessing the session.
In the logs, the python crash in the RPC call occurs after the test is done.

closes odoo/odoo#44113

Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
parent 7a109f70
No related branches found
No related tags found
No related merge requests found
......@@ -81,8 +81,18 @@ tour.register('shop_buy_product', {
{
content: "finish",
trigger: '.oe_website_sale:contains("Pending... The order will be validated after the payment.")',
// Leave /shop/confirmation to prevent RPC loop to /shop/payment/get_status.
// The RPC could be handled in python while the tour is killed (and the session), leading to crashes
run: function () {
window.location.href = '/aboutus'; // Redirect in JS to avoid the RPC loop (20x1sec)
},
timeout: 30000,
}
},
{
content: "wait page loaded",
trigger: 'h3:contains("Great products for great people")',
run: function () {}, // it's a check
},
]
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment