Daily updates from Odoo
Wednesday, July 5, 2023
1 change
Resolved issues and error corrections
User mentions in chat and related conversations now appear faster by removing an unnecessary delay while still controlling server load when responses are slow. The change also prevents a small crash that could happen when repeatedly starting and deleting a mention.
Original PR description
This reverts https://github.com/odoo/enterprise/pull/43502. Motivation for debounce was to reduce the amount of RPCs, to not put too much load on server. However, this makes showing of mention slower…
This reverts https://github.com/odoo/enterprise/pull/43502.
Motivation for debounce was to reduce the amount of RPCs, to not put too much load on server.
However, this makes showing of mention slower than it should, and the load on server is already adjusted based on duration of ongoing `fetchSuggestion` RPC: if server can reply with mentions immediately, then no need to debounce. If the RPC is slow, then next `fetchSuggestion` waits for current RPC to finish before making a new fetch.
This PR also fixes this small crash when using mentions:
```
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at cleanTerm (format.js:244:1) (/mail/static/src/utils/format.js:244)
```
Steps to reproduce:
- type `@` then `backspace` then `@` then `backspace`, etc.
This happened because suggestion hook internal state had `term` being undefined when there is no term, but `undefined` is invalid for `cleanTerm`. `""` is a better default for no search term, and since this is a string this works with `cleanTerm`.
https://github.com/odoo/odoo/pull/127399