diff options
| author | Alexandre Kühn <aku@odoo.com> | 2019-08-29 12:39:00 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2019-09-02 21:27:13 +0000 |
| commit | 15f6170bed1cf64537339d698fb78b21b98baeae (patch) | |
| tree | 81d3f352036d770a9f2cde983ee2ed99105b98f9 /addons/mail/static/src/js/models/threads/document_thread.js | |
| parent | 82c0e9b620bfbd409914e1941e5c8e9117982bd1 (diff) | |
[FIX] bus: background slave tabs should not loose notifications
Before this commit, some notifications may be lost while forwarding
them between browser tabs by means of the local storage (i.e. from
the master tab to slave tabs).
This happened when some slave tabs are in the background and are
throttled by the browser: the master tab writes twice in the local
storage (to notify slave tabs of new notifications), and slave tabs
drops the 1st notification. This is caused by the mismatch between
the new value in the local storage event and the actual value in the
local storage. For example:
```
t(0) - Master tab receives `message` notification;
t(1) - Master tab writes notifications (= `message`) in local
storage;
t(2) - Master tab receives `message_seen` notification;
t(3) - Master tab writes notifications (= `message_seen`) in
local storage;
t(4) - Slave tab detects new notifications (= `message`)
from local storage event, but drops it since it does not
match actual local storage value (= `message_seen`);
t(5) - Slave tab detects new notifications (= `message_seen`)
from local storage event, and handles it since it
matches actual local storage value (= `message_seen`);
=> Notifications received + handled:
- master tab: `message`, `message_seen`
- slave tab: `message_seen`
=> Slave tab lost "message" notification.
```
This commit fixes the issue by letting all tabs handle any local
storage events, regardless of the actual value in the local storage.
In the example above, this means the slave tab will not drop the
notification `message` at t(4).
Task-ID 2044231
Closes #36177
Diffstat (limited to 'addons/mail/static/src/js/models/threads/document_thread.js')
0 files changed, 0 insertions, 0 deletions
