Skip to content
Snippets Groups Projects
Commit c1b8c1d8 authored by Siddarth Gajjar's avatar Siddarth Gajjar Committed by Thibault Delavallée
Browse files

[FIX] website_slides: fix concurrency traceback

- Prior to this commit, slide content of type document or presentation is
  having src as '/slides/embed' and that controller tries to set slide as
  viewed. Along with this, for few slide types (including document and
  presentation) and for logged in user, it will try to set slide as completed
  once slide rendering is done with help of method `_setCompleted`, without
  waiting for the iframe to be loaded. This means, the controller called from
  the src of iFrame and the above method both tries to update same 'slide_slide'
  table at the same time, resulting into concurrency error.

- This commit fixes the issue by marking the slide as completed (with help
  of method `_setCompleted`) only after the iFrame is loaded, avoiding the
  concurrent updation of 'slide.slide' table.

TaskID 2265863
Closes https://github.com/odoo/odoo/pull/52918



closes odoo/odoo#59382

X-original-commit: c5f406c8
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 53680966
No related branches found
No related tags found
No related merge requests found
......@@ -634,7 +634,12 @@ odoo.define('website_slides.fullscreen', function (require) {
return self._renderSlide();
}).then(function() {
if (slide._autoSetDone && !session.is_website_user) { // no useless RPC call
return self._setCompleted(slide.id);
if (['document', 'presentation'].includes(slide.type)) {
// only set the slide as completed after iFrame is loaded to avoid concurrent execution with 'embedUrl' controller
self.el.querySelector('iframe.o_wslides_iframe_viewer').addEventListener('load', () => self._setCompleted(slide.id));
} else {
return self._setCompleted(slide.id);
}
}
});
},
......
......@@ -47,7 +47,7 @@ tour.register('course_member', {
}
}, {
trigger: '.o_wslides_fs_sidebar_header.navigation-success-1',
extra_trigger: '.o_wslides_progress_percentage:contains("20")',
extra_trigger: '.o_wslides_progress_percentage:contains("40")',
run: function () {
// check navigation with arrow keys
var event = jQuery.Event("keydown");
......
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