feat(perf): update query to do a simpler search [CW-2997] (#8763)

Message search would frequently timeout. The reason was that the query would join the conversation too, the new query searches the message table directly

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Shivam Mishra
2024-01-23 15:50:00 +05:30
committed by GitHub
parent d0cd1c8887
commit 834c219b9b
3 changed files with 3 additions and 3 deletions

View File

@@ -66,7 +66,7 @@ class Inbox < ApplicationRecord
has_many :inbox_members, dependent: :destroy_async
has_many :members, through: :inbox_members, source: :user
has_many :conversations, dependent: :destroy_async
has_many :messages, through: :conversations
has_many :messages, dependent: :destroy_async
has_one :agent_bot_inbox, dependent: :destroy_async
has_one :agent_bot, through: :agent_bot_inbox