Daily updates from Odoo
Tuesday, January 7, 2025
1 change · saas-17.2
Resolved issues and error corrections
This update prevents website live chat from crashing on mobile or small screens when an operator has a custom chat display name. Customers can now start and continue live chat conversations reliably in that scenario.
Original PR description
On small displays, starting a new website livechat with an operator that has an `user_livechat_username` crashes when rendering the username.
Steps to reproduce
-----
1. Select User Menu Icon > My Profile / Preferences > enter an Online Chat Name
2. On a mobile device or small window, open the livechat on the website
3. Send any new message
4. The following traceback occurs
```
Caused by: TypeError: Cannot read properties of undefined (reading 'channel_type')
at get authorName
```
Cause
-----
On small displays, `thread` for the default operator message becomes undefined when it is reassigned to the new thread. This causes an error in `get authorName()` when the undefined `thread` is accessed directly to detemine the displayed username.
Solution
-----
Add an optional chain (?) when accessing `this.message.thread` to handle the possible nullish value.
opw-4446208
Backport of odoo/odoo#192605