chatwoot/app/services/internal
Tanmay Deep Sharma 2b50909d9b
fix: use last_activity_at for orphan conversation cleanup timeframe (#13859)
## Description

The RemoveOrphanConversationsService filters orphan conversations by a
time window before deleting them. Previously it used created_at, which
could miss old conversations that still had recent activity.
Switching to last_activity_at ensures the cleanup window reflects actual
conversation activity rather than creation time.

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

- By running Rake task 
- Run the job from console 

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2026-03-20 16:28:05 +05:30
..
remove_orphan_conversations_service.rb fix: use last_activity_at for orphan conversation cleanup timeframe (#13859) 2026-03-20 16:28:05 +05:30
remove_stale_contact_inboxes_service.rb feat: Add job to remove stale contact inboxes (#8096) 2023-11-06 20:24:30 -08:00
remove_stale_contacts_service.rb feat: add job to remove stale contacts and contact_inboxes (#11186) 2025-03-28 12:18:39 +05:30
remove_stale_redis_keys_service.rb perf: reduce presence update frequency and fix background tab throttling (#13726) 2026-03-09 18:23:44 +05:30