Alexandre Kühn 221f469045 [FIX] bus: do not receive all longpolling notifs after disconnect
Revision on bus refactoring: https://github.com/odoo/odoo/commit/6448420c5dd160470e465dee7729d19d8d5e7bab

Before this commit, when a user was disconnected for a very long
time, he would receive lots of chat notifications on his next login.

Here is an example of weird behaviour with this issue:

    - User folds and unfolds a chat window 50 times
    - User disconnects for more than 50 seconds
    - User reconnects
    ==> the chat window rapidly folds and unfolds itself 50 times!

This issue comes from the fact that after 50 seconds without any
longpolling, the web client ignores the last tracked notification
and sents the ID `-1` to the server.

The web client always provides a notification ID to the server
on a `longpolling/poll`. Usually, the server returns all
notifications of the user with an ID greater than the provided ID.
There is an exception with ID `0`, in which all notifications since
the last connection of the user are returned.

The cause of the issue is a mismatch of the special notification
ID between the server and the web client. For the web client, the
ID `-1` is used for not tracking any notification, whereas the
server uses the ID `0` for this case. As a result, when the server
receives the value `-1`, it returns all notifications having an ID
greater than `-1`. In other words, it returns all notifications
related to this user, even the ones received long time ago!

This commit fixes the issue by enforcing the special notification ID
`0` on both the webclient and server.

Note that this logic is similar to 11.0:

   - The webclient uses the ID `-1` most of the time to define 'untracked':
   https://github.com/odoo/odoo/blob/11.0/addons/bus/static/src/js/bus.js#L154

   - However, it passes the ID `0` to the server:
   https://github.com/odoo/odoo/blob/11.0/addons/bus/static/src/js/bus.js#L193
2018-10-02 17:58:47 +02:00
2018-10-02 13:15:40 +02:00
2018-10-02 14:48:19 +02:00
2015-09-08 15:45:09 +02:00
2017-12-12 17:19:01 +01:00
2015-09-08 17:58:38 +02:00
2018-04-18 15:59:05 +02:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

Then follow the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%