iachat/spec/enterprise/services/enterprise
Aakash Bakhle dc0e5eb465
fix: optimize message query with account_id filter (#13759)
## Description

This PR optimizes message queries by explicitly filtering with
`account_id` so the database can use the existing indexes more
efficiently.

Changes:
- Add `account_id` to message query filters to improve index
utilization.
- Update `last_incoming_message` query to include `account_id`.
- Avoid unnecessary preloading of `contact_inboxes` where it is not
required.
- Update specs to ensure `account_id` is set correctly in
message-related tests.

These changes reduce query cost and improve performance for message
lookups, especially on large accounts.

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
2026-03-10 16:46:20 -07:00
..
auto_assignment fix: V2 Assignment service enhancements (#13036) 2026-02-11 12:24:45 +05:30
billing fix: topup checkout flaky test (#13616) 2026-02-23 14:54:52 +05:30
conversations feat: Add support for search_conversations in copilot (#11520) 2025-05-20 19:22:17 -07:00
message_templates fix: optimize message query with account_id filter (#13759) 2026-03-10 16:46:20 -07:00
action_service_spec.rb feat: sla-7 ensure applied_sla uniqueness (#8938) 2024-02-20 21:59:49 +05:30
clearbit_lookup_service_spec.rb feat: move Slack config to installation settings (#11548) 2025-05-23 01:07:35 -07:00