iachat/app/jobs
Vinay Keerthi 059506b1db
feat: Add automatic favicon fetching for companies (#13013)
## Summary

This Enterprise-only feature automatically fetches a favicon for
companies created with a domain, and adds a batch task to backfill
missing avatars for existing companies. The flow only targets companies
that do not already have an attached avatar, so existing avatars are
left untouched.


## Demo 



https://github.com/user-attachments/assets/d050334e-769f-4e46-b6e7-f7423727a192



## What changed

- Added `Avatar::AvatarFromFaviconJob` to build a Google favicon URL
from the company domain and fetch it through `Avatar::AvatarFromUrlJob`
- Triggered favicon fetching from `Company` with `after_create_commit`
- Added `Companies::FetchAvatarsJob` to batch existing companies that
are missing avatars
- Added `companies:fetch_missing_avatars` under `enterprise/lib/tasks`
- Kept the company-specific implementation inside the Enterprise
boundary
- Stubbed the new favicon request in unrelated specs that now hit this
callback indirectly
- Updated a couple of CI-sensitive specs that were failing due to
callback side effects / reload-safe exception assertions

## How to verify

1. Create a company in Enterprise with a valid domain and no avatar.
2. Confirm that a favicon-based avatar gets attached shortly after
creation.
3. Create another company with a domain and an avatar already attached.
4. Confirm that the existing avatar is not replaced.
5. Run `companies:fetch_missing_avatars`.
6. Confirm that existing companies without avatars get one, while
companies that already have avatars remain unchanged.

## Notes

- This change does not refresh or overwrite existing company avatars
- Favicon fetching only runs for companies with a present domain
- The branch includes the latest `develop`

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2026-03-05 18:51:28 -08:00
..
account feat: Introduce the crm_v2 feature flag for CRM changes (#12014) 2025-07-23 17:07:02 +04:00
agent_bots fix(agent-bot): stabilize webhook delivery for transient upstream failures (#13521) 2026-03-02 14:18:29 +04:00
agents chore: Reorganize Sidekiq Queues (#6976) 2023-05-04 15:44:16 +05:30
auto_assignment feat: Assignment service (v2) (#12320) 2025-11-17 10:08:25 +05:30
avatar feat: Add automatic favicon fetching for companies (#13013) 2026-03-05 18:51:28 -08:00
campaigns chore: one off SMS campaign APIs (#2589) 2021-07-14 12:24:09 +05:30
channels feat: Added the backend support for twilio content templates (#12272) 2025-08-24 10:05:15 +05:30
companies feat: Add automatic favicon fetching for companies (#13013) 2026-03-05 18:51:28 -08:00
contacts feat: Bulk actions for contacts (#12763) 2025-10-30 15:28:28 +05:30
conversations fix: prevent NoMethodError in mute helpers when contact is nil (#13277) 2026-01-15 22:00:09 -08:00
crm feat: integrate LeadSquared CRM (#11284) 2025-04-29 09:14:00 +05:30
inboxes fix: call authorization_error! on IMAP auth failures (#13560) (revert) (#13671) 2026-02-26 18:45:18 -08:00
internal feat: add cron job to remove orphan conversations (#13335) 2026-01-28 19:25:20 +05:30
labels fix: Update associations when a label is updated (#3046) 2021-09-21 10:16:32 +05:30
migration feat: Backend - Companies API endpoint with pagination and search (#12840) 2025-11-18 14:28:56 +05:30
notification perf: limit the number of notifications per user to 300 (#13234) 2026-01-28 17:35:13 +05:30
webhooks feat: Handle external echo messages from native apps (#13371) 2026-02-02 15:52:53 +05:30
action_cable_broadcast_job.rb chore: Add more conversation events for reload (#10877) 2025-02-11 00:33:45 -08:00
application_job.rb chore: Improve active job error logs for deserialization error (#8742) 2024-01-18 19:27:18 +04:00
bulk_actions_job.rb feat: Add support for bulk snooze until (#9360) 2024-05-08 08:55:31 +05:30
contact_ip_lookup_job.rb feat(poc): Disable widget based on country (#6658) 2023-03-14 09:09:57 -07:00
conversation_reply_email_job.rb feat: add per-account daily rate limit for outbound emails (#13411) 2026-02-03 02:06:51 +05:30
data_import_job.rb fix: Avoid double notification email after importing contacts (#13150) 2026-01-09 15:11:19 -08:00
delete_object_job.rb fix: Prevent SLA deletion timeouts by moving to async job (#12944) 2025-12-10 12:28:47 +05:30
event_dispatcher_job.rb chore: Reorganize Sidekiq Queues (#6976) 2023-05-04 15:44:16 +05:30
hook_job.rb feat: integrate LeadSquared CRM (#11284) 2025-04-29 09:14:00 +05:30
macros_execution_job.rb feat: Execute macro actions, for the conversation (#5066) 2022-07-26 12:41:22 +05:30
mutex_application_job.rb fix: mutex timeout and error handling (#8770) 2024-01-24 14:18:21 +04:00
send_on_slack_job.rb fix: mutex timeout and error handling (#8770) 2024-01-24 14:18:21 +04:00
send_reply_job.rb feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
slack_unfurl_job.rb feat: Support link unfurling for all the channels within the same connected channel account. (#8033) 2023-10-08 17:55:03 +05:30
trigger_scheduled_items_job.rb perf: limit the number of notifications per user to 300 (#13234) 2026-01-28 17:35:13 +05:30
webhook_job.rb feat: add per-webhook secret with backfill migration (#13573) 2026-02-26 17:26:12 +05:30