iachat/app
Vishnu Narayanan 7c5bb343c6
fix: Optimize message reindexing to reduce sidekiq job creation (#12618)
Changes searchkick callback behavior to check `should_index?` before
creating reindex jobs, preventing unnecessary job creation for messages
that don't need indexing (activity messages, unpaid accounts, etc.).

Previously, `callbacks: :async` created reindex jobs for all messages
(~5,100/min or 7.3M/day in production), which were then filtered by
`should_index?` inside the job worker - resulting in 98% wasted jobs,
Redis memory pressure, and avoidable p0 alerts.

Now, `should_index?` is checked before job creation via `after_commit`
callback, reducing job creation to actual incoming/outgoing messages
from paid accounts.

  Changes:
  - Disable automatic searchkick callbacks
  - Add manual `after_commit` callback with `should_index?` condition
  - Add specs to verify callback behavior

  Expected impact:
  - 98% reduction in sidekiq job creation (~7.3M → ~150K jobs/day)
  - Reduced redis memory usage
  - Same async indexing behavior for eligible messages
2025-10-09 16:04:50 +05:30
..
actions fix: Disable enqueueing Avatar jobs if the URL is invalid (#12035) 2025-07-24 12:56:39 +04:00
assets feat: Hide installation identifier (#11722) 2025-06-17 15:45:40 -07:00
builders fix: Rendering on email without html content (#12561) 2025-10-01 13:43:05 +05:30
channels fix: Move contact events to account stream rather than individual user stream (#11082) 2025-03-13 17:46:48 -07:00
controllers feat: Add relay state for SAML SSO (#12597) 2025-10-07 20:32:29 +05:30
dashboards feat: Auto confirm user email when super admin make changes (#12418) 2025-09-23 20:14:02 +05:30
dispatchers feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
drops feat: Add the support for custom attributes in message variables (#8511) 2023-12-08 14:13:35 -08:00
fields chore: improve plan-based feature handling with plan hierarchy (#11335) 2025-04-28 14:13:56 -07:00
finders feat: add SKIP_INCOMING_BCC_PROCESSING as internal config (#12484) 2025-09-22 17:52:56 +05:30
helpers fix: Add URL validation and rate limiting for contact avatar sync (#11979) 2025-09-10 20:08:06 +05:30
javascript feat: Add relay state for SAML SSO (#12597) 2025-10-07 20:32:29 +05:30
jobs fix(delete_object_job): pre-purge heavy associations before destroy to prevent timeout (#12408) 2025-09-11 18:43:36 +05:30
listeners fix: incorrect first response time for reopened conversations (#12058) 2025-08-13 16:39:43 +05:30
mailboxes fix: Use .find_by instead .where().first (#12402) 2025-09-10 10:08:37 +05:30
mailers feat: Clean up email configuration for from and reply to emails (#12453) 2025-09-24 11:36:53 -07:00
models fix: Optimize message reindexing to reduce sidekiq job creation (#12618) 2025-10-09 16:04:50 +05:30
policies feat: Add WhatsApp health monitoring and self-service registration completion (#12556) 2025-10-02 11:25:48 +05:30
presenters fix: Disable automations on auto-reply emails (#12101) 2025-08-05 13:17:06 +05:30
services fix: Normalize URLs with spaces in WhatsApp template parameters (#12594) 2025-10-08 15:33:06 +05:30
views perf: Contact optimisation fixes (#12016) 2025-09-25 18:59:55 +05:30
workers feat: API Endpoints to update message status (#11387) 2025-04-29 15:33:11 -07:00