-
- Downloads
[FIX] bus: keep last notification id during refresh
Before the websocket were introduced, the last notification id was
persisted in the local storage in order to use it even after a page
reload.
The last notification id is now stored on the `SharedWorker` which
means this information is lost if the last opened tab is reloaded.
This commit fixes this issue by storing this information by the mean of
the localStorage. Since the localStorage is not accessible from the
worker global scope, the bus service will store this information and
relay it to the worker when starting. The worker will now wait to
receive the last notification id before subscribing.
closes odoo/odoo#99621
Related: odoo/enterprise#31124
Signed-off-by:
Sébastien Theys (seb) <seb@odoo.com>
Showing
- addons/bus/models/__init__.py 1 addition, 0 deletionsaddons/bus/models/__init__.py
- addons/bus/models/ir_http.py 18 additions, 0 deletionsaddons/bus/models/ir_http.py
- addons/bus/static/src/services/bus_service.js 13 additions, 3 deletionsaddons/bus/static/src/services/bus_service.js
- addons/bus/static/src/workers/websocket_worker.js 4 additions, 2 deletionsaddons/bus/static/src/workers/websocket_worker.js
- addons/bus/static/tests/bus_tests.js 60 additions, 0 deletionsaddons/bus/static/tests/bus_tests.js
- addons/bus/static/tests/helpers/mock_server.js 5 additions, 1 deletionaddons/bus/static/tests/helpers/mock_server.js
- addons/bus/static/tests/websocket_worker_tests.js 1 addition, 1 deletionaddons/bus/static/tests/websocket_worker_tests.js
addons/bus/models/ir_http.py
0 → 100644
Please register or sign in to comment