iachat/spec/builders
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
..
campaigns chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
csat_surveys chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
email feat: Clean up email configuration for from and reply to emails (#12453) 2025-09-24 11:36:53 -07:00
messages feat(facebook): Mark Messenger native-app echoes as external echo message (#13665) 2026-02-26 19:05:15 +04:00
v2 feat: Add automatic favicon fetching for companies (#13013) 2026-03-05 18:51:28 -08:00
account_builder_spec.rb fix: account email validation during signup (#11307) 2025-05-20 20:45:39 -07:00
agent_builder_spec.rb fix: Avoid duplicate invitation emails when adding an agent (#9131) 2024-03-26 18:58:45 -07:00
contact_inbox_builder_spec.rb chore: Add cache to improve widget performance (#11163) 2025-03-24 16:04:49 -07:00
contact_inbox_with_contact_builder_spec.rb feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30
conversation_builder_spec.rb feat: Ability to lock the conversation to a single thread in API channels (#10329) 2024-12-09 23:36:17 +08:00
notification_builder_spec.rb fix: Exclude notifications for blocked contacts, except mentions (#10659) 2025-01-12 15:30:27 +05:30
year_in_review_builder_spec.rb feat(ce): Add Year in review feature (#13078) 2025-12-15 17:24:45 -08:00