iachat/spec/enterprise/models
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
..
captain feat: include contact verified status with each tool call (#13663) 2026-02-26 16:16:33 +05:30
channel feat(voice): Improved voice call creation flow [EE] (#12268) 2025-08-22 13:38:23 +02:00
concerns feat: add campaign context to Captain v2 prompts (#13644) 2026-02-25 18:33:37 +05:30
enterprise/concerns chore: Automate SSL with Cloudflare (#12021) 2025-07-24 13:09:06 +04:00
account_saml_settings_spec.rb feat: update users on SAML setup and destroy [CW-2958][CW-5612] (#12346) 2025-09-15 21:20:22 +05:30
account_spec.rb chore: Update account deletion email copy (#12317) 2025-08-31 16:01:41 +02:00
account_user_spec.rb feat: Add APIs to manage custom roles in Chatwoot (#9995) 2024-08-23 17:18:28 +05:30
agent_capacity_policy_spec.rb feat: Add agent capacity controllers (#12200) 2025-08-26 19:12:58 -07:00
applied_sla_spec.rb feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
assignment_policy_spec.rb feat: Add assignment policies controllers with jbuilder views (#12199) 2025-08-18 19:15:21 -07:00
automation_rule_spec.rb feat: sla-2 add automation backend support for SLA (#8775) 2024-02-01 15:42:12 +05:30
company_spec.rb feat: Add company model and API with tests (#12548) 2025-10-08 07:53:43 -07:00
contact_company_association_spec.rb feat: Add company auto-association for contacts (CW-5726 Part 2) (#12711) 2025-11-03 20:36:13 +05:30
conversation_spec.rb feat: Add automatic favicon fetching for companies (#13013) 2026-03-05 18:51:28 -08:00
copilot_message_spec.rb fix: Update specs, add background response job implementation for copilot threads (#11600) 2025-05-27 14:10:27 -06:00
copilot_thread_spec.rb feat: Add support for more tool, standardize copilot chat service (#11560) 2025-05-23 01:07:07 -07:00
custom_attribute_definition_spec.rb feat: Conversation workflows(EE) (#13040) 2026-01-27 11:36:20 +04:00
custom_role_spec.rb feat: Add APIs to manage custom roles in Chatwoot (#9995) 2024-08-23 17:18:28 +05:30
inbox_capacity_limit_spec.rb feat: Add agent capacity controllers (#12200) 2025-08-26 19:12:58 -07:00
inbox_member_spec.rb feat: auditlog for team and inbox member updates (#7516) 2023-08-15 19:55:19 -07:00
inbox_spec.rb feat: MFA (#12290) 2025-09-18 20:19:24 +05:30
macro_spec.rb feat: add audit trail for macros (#7352) 2023-06-20 13:04:59 +05:30
message_spec.rb fix: captain talking over support agent (#13673) 2026-03-03 16:13:34 +05:30
sla_event_spec.rb feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
sla_policy_spec.rb feat: sla 1 - refactor sla_policies model and add applied_sla model (#8602) 2024-01-23 23:48:02 +05:30
team_member_spec.rb feat: auditlog for team and inbox member updates (#7516) 2023-08-15 19:55:19 -07:00
team_spec.rb feat: Add audit trail events for team (#7285) 2023-06-09 17:30:36 -07:00
user_spec.rb chore: Move Enterprise pricing validation to on create (#8856) 2024-02-05 19:18:29 +05:30
webhook_spec.rb feat: Audit log APIs (#6434) 2023-03-01 20:02:58 +05:30