Skip to content

Conversation

@MaxTheWhale
Copy link
Contributor

Steps to reproduce:

  1. Pair an IoT box
  2. In the IoT form view, click on any device, then click back to return to the IoT form view.
  3. Repeat this step multiple times. If you have devtools open, you can see a /event fetch request every time you open the device form.

Expected behaviour:

  • When a new request is made, the previous request is cancelled.

Actual behaviour:

  • The previous requests remain active, and eventually no further requests are possible due to browser limits.

This behaviour was broken when the longpolling was changed to use the fetch method instead of Odoo's rpc method. This commit restores the behaviour by using an AbortController instance which is aborted when stopPolling is called.

Manual Forward Port of Enterprise PR: https://github.com/odoo/enterprise/pull/98985


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Nov 7, 2025

Pull request status dashboard

@C3POdoo C3POdoo requested review from a team, kmagusiak and ryv-odoo and removed request for a team November 7, 2025 08:22
@MaxTheWhale MaxTheWhale force-pushed the saas-18.3-iot_base-longpolling-abort-mawh branch from 08214df to ca47e6e Compare November 7, 2025 08:22
Copy link
Contributor

@loouis-t loouis-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo delegate+

@MaxTheWhale MaxTheWhale force-pushed the saas-18.3-iot_base-longpolling-abort-mawh branch from ca47e6e to f485b97 Compare November 7, 2025 08:31
@MaxTheWhale
Copy link
Contributor Author

@robodoo r+

@MaxTheWhale
Copy link
Contributor Author

@robodoo up to 19.0

@robodoo
Copy link
Contributor

robodoo commented Nov 7, 2025

Forward-porting to '19.0'.

@MaxTheWhale MaxTheWhale force-pushed the saas-18.3-iot_base-longpolling-abort-mawh branch from f485b97 to c3a48d0 Compare November 7, 2025 08:41
@MaxTheWhale
Copy link
Contributor Author

@robodoo r+

Steps to reproduce:
1. Pair an IoT box
2. In the IoT form view, click on any device, then click back to return
   to the IoT form view.
3. Repeat this step multiple times. If you have devtools open, you can
   see a `/event` fetch request every time you open the device form.

Expected behaviour:
- When a new request is made, the previous request is cancelled.

Actual behaviour:
- The previous requests remain active, and eventually no further
  requests are possible due to browser limits.

This behaviour was broken when the longpolling was changed to use the
`fetch` method instead of Odoo's `rpc` method. This commit restores the
behaviour by using an `AbortController` instance which is aborted when
`stopPolling` is called.
@MaxTheWhale MaxTheWhale force-pushed the saas-18.3-iot_base-longpolling-abort-mawh branch from c3a48d0 to 3895da1 Compare November 7, 2025 09:17
@MaxTheWhale
Copy link
Contributor Author

@robodoo r+

robodoo pushed a commit that referenced this pull request Nov 7, 2025
Steps to reproduce:
1. Pair an IoT box
2. In the IoT form view, click on any device, then click back to return
   to the IoT form view.
3. Repeat this step multiple times. If you have devtools open, you can
   see a `/event` fetch request every time you open the device form.

Expected behaviour:
- When a new request is made, the previous request is cancelled.

Actual behaviour:
- The previous requests remain active, and eventually no further
  requests are possible due to browser limits.

This behaviour was broken when the longpolling was changed to use the
`fetch` method instead of Odoo's `rpc` method. This commit restores the
behaviour by using an `AbortController` instance which is aborted when
`stopPolling` is called.

closes #234872

Signed-off-by: Max Whale (mawh) <mawh@odoo.com>
@robodoo robodoo closed this Nov 7, 2025
@fw-bot fw-bot deleted the saas-18.3-iot_base-longpolling-abort-mawh branch November 14, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants