abd-msyukyu-odoo 708573b0f5 [FIX] web: prevent command palette deadlock
Impacted versions:
16.0+

How to reproduce:
- create a lot of articles in Knowledge (i.e. 3000+)
- click twice on the `Search Articles` fake search bar in the Knowledge Form
  view

Current behavior:
- the command palette does not open
- the command palette is broken and won't open again (even with the `CTRL+K`
  shortcut)

Expected behavior:
- the command palette open once and should not break even if the user clicks
  multiple times.

Technical explanation:
- The promise given to the `onWillStart` hook of the `command_palette` can
  sometimes never be resolved by design (see `KeepLast`). i.e.:
  - `setCommandPaletteConfig` is called `onWillStart`
  - `setCommandPaletteConfig` is then called as a result of the `SET-CONFIG`
    bus event
  - the first promise will never be resolved since it uses a `KeepLast`,
    therefore `onWillStart` will never be resolved either.
- In `command_service`, the variable `isPaletteOpened` is set to `true` before
  the command palette dialog is actually mounted.
- If `onWillStart` is never resolved, the component will never be mounted, and
  as such the dialog can never be closed, therefore `isPaletteOpened` stays
  `true` forever resulting in a deadlock preventing any further opening of the
  command palette.

The issue can be resolved by adding all `KeepLast` promises in a race, which is
what `onWillStart` should actually be waiting for, since it will be resolved as
soon as any `KeepLast` promise is resolved.

task-3554068

closes odoo/odoo#141613

X-original-commit: 6b5fc71e67569b93b699090b225eea147ef463d2
Related: odoo/enterprise#50466
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2023-11-08 14:36:27 +00:00
2023-10-27 08:36:16 +00:00
2023-11-02 21:02:44 +00:00
2023-11-07 21:02:19 +00: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, ...

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.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with 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%