summaryrefslogtreecommitdiff
path: root/addons/resource/data/resource_data.xml
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-11-15 23:43:23 +0000
committerAlexandre Kühn <aku@odoo.com>2018-11-16 14:04:46 +0000
commite3f36b10ac6c47954dd29b003161a289f7baaeb3 (patch)
treec6c1d94e5dfb9a6e9c2dd2472d0269d73b908b21 /addons/resource/data/resource_data.xml
parent7613db4178c8de6c054876e43e2680ef8672d8c3 (diff)
[FIX] mail: no crash when searching messages
Revision on https://github.com/odoo/odoo/commit/299ebb2cdf63de2e3967da0d2f3e7effd239812b The commit above added the notion of moderation, which requires re-rendering the thread when a message has its moderation changed (i.e. the message is deleted on reject or is no longer marked as 'pending moderation'). However, this condition was triggered even when the moderation status on the message has not changed. This introduced a crash when using the search in discuss: - Access a channel with more than 30 messages, so that not all messages have been fetched. - Search messages in this thread so that it displays more than 30 messages, and the last message of those has already been fetched. > It crashes with "Cannot read property 'getID' of undefined". The bug comes from re-fetching messages: it behaves as a "load more" fetch, although no message has been stored yet. A "load more" fetch requires at least one message in order to determine the minimum message ID to fetch, thus the crash due to having no message to get such an ID. Here's the explanation why it fetches with load more: when performing the search and fetching the same last message, it will detect that it has already been fetched. Its moderation status is 'accepted', and it will assume a change of moderation status. This will trigger a fetch and render of the thread. At this moment, if the search exceeds the fetch limit, not all messages will be fetched, so that this fetch is considered as a "load more" fetch. This commit fixes the issue by only re-rendering the thread when there is a change of the moderation status on an already fetched message. Since changes of the moderation status are handled by means of the longpolling, it should be rare to run into the case of having a change of moderation status on a message while using the search on a thread. Task-ID 1910180
Diffstat (limited to 'addons/resource/data/resource_data.xml')
0 files changed, 0 insertions, 0 deletions