[FIX] bus: watch for changed assets in backend only
Since 1 when the bus service was adapted to wowl, the assets watchdog service was imported in the frontend. Because the assets will be the right ones on the next visited page, the notification it might trigger is seen as degrading the website UX.
This commit makes the assets watchdog service only active for backend pages.
Steps to reproduce:
- Visit a public page in a tab - keep it open.
- From a different browser, log in and rebuild assets. => Notification appears in visitor's tab.
task-2922959
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
@rdeodoo Re-rebased on 16.0 - now that 16.0 is not red anymore.
As the assets_common where duplicated in assets_frontend in a recent commit, the PR actually needed to be adapted -> Move the 'remove' line from assets_commins to assets_frontend
@rdeodoo Now the JS is simply removed from frontend.
Hello @qsm-odoo, this notif is trigerred by the bus service when the websocket connection is lost, so this PR won't solve the problem. As for the 15.0 case, the poll was started lazily, which is not the case with the websocket which is started as soon as the worker loads. That explains why the connection lost pop up is not present on your screenshot: the connection is lost, and any opened poll/outgoing rpc would trigger it but since nothing happens yet.. On the other hand, the websocket connection is notified as soon as it is closed resulting in the pop up being shown immediately.
What would you think of checking session.is_frontend in order to hide it when necessary ? If this solution satisfies you, I can create a PR to do so :)
As for @rdeodoo, I believe he was talking about the "outdated assets" popup, not this one ?
That's indeed another one we fixed/removed: the one about outdated assets, see

What would you think of checking session.is_frontend in order to hide it when necessary ? If this solution satisfies you, I can create a PR to do so :)
AFAIC, something along those lines would be fine I guess, we never want to display such a toaster, do we?
But actually, why is the websocket connection lost/closed everytime when google page speed is fetching the homepage as per the screenshot?
