[FIX] mail: ptt extension race condition
The push-to-talk extension service sends a message to the extension when starting to check if it is enabled. If the response is received before the RTC service is started, the answer is ignored, and the service acts as if the extension were not available. This PR fixes this issue. closes odoo/odoo#158252 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -12,7 +12,10 @@ export const pttExtensionHookService = {
|
||||
|
||||
browser.addEventListener("message", ({ data }) => {
|
||||
const rtc = env.services["discuss.rtc"];
|
||||
if (data.from !== "discuss-push-to-talk" || !rtc) {
|
||||
if (
|
||||
data.from !== "discuss-push-to-talk" ||
|
||||
(!rtc && data.type !== "answer-is-enabled")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
switch (data.type) {
|
||||
|
||||
Reference in New Issue
Block a user