-
Notifications
You must be signed in to change notification settings - Fork 30.1k
[PERF] bus, *: only update presence when needed #174814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
07aafb3
to
1b1f8b7
Compare
1b1f8b7
to
0b522c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robodoo delegate+
0b522c5
to
247e479
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robodoo overrice=ci/security
in this case, I don't think we need cors='*' as the cross-site front-end doesn't need to read the result of the request for it to works. But it doens't hurt to avoid a cors error
@flvr-odoo unknown command 'overrice'. For your own safety I've ignored everything in your entire comment. Currently available commands:
Note: this help text is dynamic and will change with the state of the PR. |
robodoo override=ci/security |
*: hr_holidays, mail. Before this PR, the main tab updated the user presence every minute. As a result of this update, it would also receive the IM statuses it was interested in. However, this approach puts significant pressure on the gevent worker, especially when it handles more databases than the registry can hold. To address this issue, this PR improves the way presences are updated: - Presences are sent and broadcasted when they change (e.g. away => online). - When a websocket disconnects, the user is considered disconnected. If other devices receive this notification, they will update the user presence immediately. These changes greatly reduce traffic caused by presence updates while keeping the IM statuses reliable.
247e479
to
bd62360
Compare
@robodoo r+ |
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (odoo#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model.
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. closes #199936 Signed-off-by: Giorgio Tocco (gito) <gito@odoo.com>
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (odoo#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. X-original-commit: ff16614
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. closes #202776 X-original-commit: ff16614 Signed-off-by: Giorgio Tocco (gito) <gito@odoo.com>
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (odoo#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. X-original-commit: 11f92be
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. closes #203903 X-original-commit: 11f92be Signed-off-by: Giorgio Tocco (gito) <gito@odoo.com>
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (odoo#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. X-original-commit: 01df2f7
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. closes #204307 X-original-commit: 01df2f7 Signed-off-by: Giorgio Tocco (gito) <gito@odoo.com>
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (odoo#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. X-original-commit: c74ef6a
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. closes #204485 X-original-commit: c74ef6a Signed-off-by: Giorgio Tocco (gito) <gito@odoo.com>
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (odoo#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. X-original-commit: f443933
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. closes #205269 X-original-commit: f443933 Signed-off-by: Giorgio Tocco (gito) <gito@odoo.com>
Before this commit, the IM status icon shown when the user is homeworking won't always be precise. This happens because of the IM status refactoring (odoo/odoo#174814). Steps to reproduce: 1. Setup user Marc Demo as homeworking in the current day 2. As Marc Demo open Discuss 3. As Mitchell Admin open the conversation with Marc Demo -> the correct home online icon is shown 4. As Marc Demo close all Odoo tabs -> user goes offline and Mitchell Admin sees the correct offline icon 5. As Marc Demo reopen Discuss -> Mitchell Admin sees the circle icon instead of the home icon This commit fixes the issue by sending the user im_status information directly from its indentity model (`res.partner` or `mail.guest`) in the `bus.bus/im_status_updated` notification payload. This ensures that any overrides on the `im_status` field will be taken into consideration without having to re-establish the override client side. `presence_status` now represents the status value of the presence model, while `im_status` represents the status value of the identity model. closes odoo/odoo#203903 X-original-commit: 11f92becef55dc2994b5a63bc0951867b9ff3349 Signed-off-by: Giorgio Tocco (gito) <gito@odoo.com>
*: hr_holidays, mail.
Before this PR, the main tab updated the user presence every minute. As a result of this update, it would also receive the IM statuses it was interested in.
However, this approach puts significant pressure on the gevent worker, especially when it handles more databases than the registry can hold.
To address this issue, this PR improves the way presences are updated:
These changes greatly reduce traffic caused by presence updates while keeping the IM statuses reliable.